tuple
The tuple class returns an immutable iterable object of type tuple (a tuple).
The tuple class returns an immutable iterable object of type tuple (a tuple).
The slice class returns an object representing the indices specified by range(start, stop, step).
The set built-in class returns a set made up of the elements of the iterable included as an argument.
The reversed function returns an iterator made up of the values of the object included as an argument after reversing their order.
The range function represents an immutable sequence of integers. If used by passing it a single stop argument, it generates a sequence of consecutive integers between 0 and stop -1. If used by passing it two arguments, start and stop, it generates a sequence of consecutive integers between start and stop -1. In the latter case, the inclusion of a third step argument forces the sequence of numbers to be generated with a "step" jump between one number and the next.
The next function returns the next element of the iterator included as the first argument by invoking its __next__ method.
In the case that the iterator is empty, an exception of type StopIteration will be generated unless a second argument ("default") has been included, in which case it will be returned as a result of the function.
The iter function returns an iterable object from another object. In its simplest configuration it will only receive one argument -the object to be made iterable-. This requires that said object support the iteration or sequence protocols (__iter__ and __getitem__ methods respectively). If none of them are supported, the iter function will return a type error (TypeError).
The map function applies a function to the values of the iterable that we specify as an argument. In the case that two or more iterables are specified as arguments, the function will consider their values in parallel, stopping returning values as soon as the end of the shortest iterable is reached (see examples below).
The issubclass function takes two classes, class and classinfo, as arguments, and returns the boolean True if class is a subclass of classinfo, or False otherwise.
A class is always considered a subclass of itself.
The isinstance function takes an object and a class as arguments and returns True if the object is an instance of that class or an instance of a subclass of it.
The second argument (the class) can also be a tuple of classes or a recursive structure of tuples of classes, in which case the boolean True will be returned if the object belongs to any of the classes contained in the structure.
Excepto donde se indique otra cosa, los contenidos de este sitio web se ofrecen bajo una licencia Reconocimiento-NoComercial-SinObraDerivada 4.0 Internacional