根据iterable 中的项返回一个新的已排序列表。 Returns a sorted list from the iterable . 如果未指定iterable ,则将返回一个新的空集合。 If iterable is not specified, a new empty frozenset is returned. If iterable is not specified, the new deque is empty. 返回一个新的set对象,可以选择带有从iterable 获取的元素。 Return a new set, optionally with elements taken from iterable . 如果iterable 已经是一个元组,会不加改变地将其返回。 If iterable is already a tuple, it is returned unchanged.
Accepts any iterable as its argument and makes the list larger. Iterable 必须是空元组,并且新的deque被创建为空。Iterable must be the empty tuple, and the new deque is created empty. 返回一个新的set或frozenset对象,其元素来自于iterable 。 Return a new frozenset object whose elements are taken from iterable . 因此,使用extend,iterable 的每个元素都会附加到列表中。 So with extend, each element of the iterable gets appended onto the list. 创建一个迭代器,返回iterable 中所有元素并保存一个副本。 Make an iterator returning elements from the iterable and saving a copy of each. 这条路也是Iterable 想要遵循的,用这一轮来帮助它到达那里。 That's a path that Iterable wants to follow, too, with this round to help it get there. Iterable 必须是一个序列,或iterator,或其他支持迭代的对象。Iterable should be in a series, an iterator, or various other object that backs iteration. 如果start不是0,跳过iterable 中的元素,直到到达start这个位置。 If start is non-zero, then elements from the iterable are skipped until start is reached. Iterable 有一个不同的起源,因为它的创始人来自技术背景。Iterable has a bit of a different origin story in that its founders come from technical backgrounds. 它也像extend一样工作,因为第二个iterable 可以是任何类型的iterable 。 It also works like extend, in that the second iterable can be any kind of iterable . Iterable 的项通常为数字,开始值则不允许为字符串。The iterable 's items are often numbers, and the start value just is not allowed to be a string. 返回一个新的双向队列对象,从左到右初始化(用方法append()),从iterable (迭代对象数据创建。 Returns a new deque object initialized left-to-right(using append()) with data from iterable . Iterable 的项通常为数字,而start值则不允许为字符串。The iterable ‘s items are normally numbers, and the start value is not allowed to be a string. 更好的方案是使用Iterable ,它能够避免在内存中创建中间状态的token副本:. A better solution would be using an Iterable , which avoids intermediate token copies to be created in memory:. 如果function是None,则会假设它是一个身份函数,即iterable 中所有返回假的元素会被移除。 If function is None, the identity function is assumed, that is, all elements of iterable that are false are removed. 返回True,如果iterable 的所有元素都为true(或者iterable 为空).等价于:. It returns True if all elements of the iterable are true(or if the iterable is empty). Collections.abc模块定义了一组有用的ABCs例如Iterable ,Container,和MutableMapping. The collections module defines a set of useful ABCs such as Iterable , Container, and MutableMapping. Iterable 是列表理解的最后一部分,所有生成器都是iterable ,因此,它们通常是这样使用的:.An iterable is the last part of a list comprehension, and all generators are iterable , so they're often used like so:. 如果r未指定或为None,r默认设置为iterable 的长度,这种情况下,生成所有全长排列。 If r is not specified or is None, then r defaults to the length of the iterable and all possible full-length permutations are generated. 这显然是一个合理的iterable ,它的行为定义得很好--每次生成器遍历它,它都返回4(并且永远这样做)。 This is clearly a reasonable iterable whose behavior is well defined-- each time the generator iterates over it, it returns 4(and does so forever). EnhancedForLoop(有时也被称作foreach循环),可以用在实现了Iterable 接口的集合类型以及数组类型上。 The enhanced for loop(also sometimes known as“for-each” loop) can be used for collections that implement the Iterable interface and for arrays. Sorted(iterable,key=None,reverse=False)会将iterable 中的元素收集到一个列表中,然后排序并返回结果。 Sorted(iterable, key=None, reverse=False) collects all the elements of the iterable into a list, sorts the list, and returns the sorted result. 还有两种具有相同语法优先级的运算in和notin,它们被iterable 或实现了__contains__()方法的类型所支持。 Two more operations with the same syntactic priority, in and not in, are supported by types that are iterable or implement the__contains__() method. 接口被命名为类,例如,Collection或Comparator,或者以能够或者为结尾的形容词,例如,Runnable,Iterable 或Accessible。 Interfaces are named like classes, for example, Collection or Comparator, or with an adjective ending in able or ible, for example, Runnable, Iterable , or Accessible.
Display more examples
Results: 29 ,
Time: 0.0178