Results of 1 - 10 of about 71 for reversed (0.010 sec.)
- collections.abc --- コンテナの抽象基底クラス — Python 3.14.8 ドキュメント 12495
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » collections.abc --- コンテナの抽象基底クラス テーマ 自動 ライト ダーク | collections.abc --- コンテナの抽象基底クラス ¶
...ssubclass ( D , Sequence ) True >>> isinstance ( D (), Sequence ) True この例では、クラス D は __contains__ , __iter__ , __reversed__ を定義する必要がありません。なぜなら in 演算子 , the 反復 ロジック, および reversed() 関数は自動的に __getitem__ と __le...ashable [ 1 ] __hash__ Iterable [ 1 ] [ 2 ] __iter__ Iterator [ 1 ] Iterable __next__ __iter__ Reversible [ 1 ] Iterable __reversed__ Generator [ 1 ] Iterator send , throw close , __iter__ , __next__ Sized [ 1 ] __len__ Callable [ 1 ] __call__ Collection...ainer __contains__ , __iter__ , __len__ Sequence Reversible , Collection __getitem__ , __len__ __contains__ , __iter__ , __reversed__ , index , count MutableSequence Sequence __getitem__ , __setitem__ , __delitem__ , __len__ , insert Sequence から継承した... - https://man.mtool.work/python/3.14/library/collections.abc.html
- collections.abc --- コンテナの抽象基底クラス — Python 3.14.8 ドキュメント 11680
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » collections.abc --- コンテナの抽象基底クラス テーマ 自動 ライト ダーク | collections.abc --- コンテナの抽象基底クラス ¶
...ssubclass ( D , Sequence ) True >>> isinstance ( D (), Sequence ) True この例では、クラス D は __contains__ , __iter__ , __reversed__ を定義する必要がありません。なぜなら in 演算子 , the 反復 ロジック, および reversed() 関数は自動的に __getitem__ と __le...ashable [ 1 ] __hash__ Iterable [ 1 ] [ 2 ] __iter__ Iterator [ 1 ] Iterable __next__ __iter__ Reversible [ 1 ] Iterable __reversed__ Generator [ 1 ] Iterator send , throw close , __iter__ , __next__ Sized [ 1 ] __len__ Callable [ 1 ] __call__ Collection...ainer __contains__ , __iter__ , __len__ Sequence Reversible , Collection __getitem__ , __len__ __contains__ , __iter__ , __reversed__ , index , count MutableSequence Sequence __getitem__ , __setitem__ , __delitem__ , __len__ , insert Sequence から継承した... - https://man.mtool.work/python/3.14/library/collections.abc.html
- ソートのテクニック — Python 3.14.8 ドキュメント 11146
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » ソートのテクニック テーマ 自動 ライト ダーク | ソートのテクニック ¶ Author : Andrew Dalke and Raymond Hettinger Python のリストにはリストをインプレ
...ソート順序のタプルを複数受け取れるラッパー関数へ抽象化できます。 >>> def multisort ( xs , specs ): ... for key , reverse in reversed ( specs ): ... xs . sort ( key = attrgetter ( key ), reverse = reverse ) ... return xs >>> multisort ( list ( student_obje...トの安定性を保ちます (ですから、レコードのキーが等しい場合元々の順序が維持されます)。面白いことにこの影響はパラメータ無しで reversed() 関数を二回使うことで模倣することができます: >>> data = [( 'red' , 1 ), ( 'blue' , 1 ), ( 'red' , 2 ), ( 'blue' , 2 )] >>...> standard_way = sorted ( data , key = itemgetter ( 0 ), reverse = True ) >>> double_reversed = list ( reversed ( sorted ( reversed ( data ), key = itemgetter ( 0 )))) >>> assert standard_way == double_reversed >>> s... - https://man.mtool.work/python/3.14/howto/sorting.html
- ソートのテクニック — Python 3.14.8 ドキュメント 11146
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » ソートのテクニック テーマ 自動 ライト ダーク | ソートのテクニック ¶ Author : Andrew Dalke and Raymond Hettinger Python のリストにはリストをインプレ
...ソート順序のタプルを複数受け取れるラッパー関数へ抽象化できます。 >>> def multisort ( xs , specs ): ... for key , reverse in reversed ( specs ): ... xs . sort ( key = attrgetter ( key ), reverse = reverse ) ... return xs >>> multisort ( list ( student_obje...トの安定性を保ちます (ですから、レコードのキーが等しい場合元々の順序が維持されます)。面白いことにこの影響はパラメータ無しで reversed() 関数を二回使うことで模倣することができます: >>> data = [( 'red' , 1 ), ( 'blue' , 1 ), ( 'red' , 2 ), ( 'blue' , 2 )] >>...> standard_way = sorted ( data , key = itemgetter ( 0 ), reverse = True ) >>> double_reversed = list ( reversed ( sorted ( reversed ( data ), key = itemgetter ( 0 )))) >>> assert standard_way == double_reversed >>> s... - https://man.mtool.work/python/3.14/howto/sorting.html
- itertools --- 効率的なループ用のイテレータ生成関数群 — Python 3.14.8 ドキュメン... 9530
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 関数型プログラミング用モジュール » itertools --- 効率的なループ用のイテレータ生成関数群 テーマ 自動 ライト ダーク | itertools --- 効
...( pool ) if r > n : return indices = list ( range ( r )) yield tuple ( pool [ i ] for i in indices ) while True : for i in reversed ( range ( r )): if indices [ i ] != i + n - r : break else : return indices [ i ] += 1 for j in range ( i + 1 , r ): indic...len ( pool ) if not n and r : return indices = [ 0 ] * r yield tuple ( pool [ i ] for i in indices ) while True : for i in reversed ( range ( r )): if indices [ i ] != n - 1 : break else : return indices [ i :] = [ indices [ i ] + 1 ] * ( r - i ) yield t...nge ( n )) cycles = list ( range ( n , n - r , - 1 )) yield tuple ( pool [ i ] for i in indices [: r ]) while n : for i in reversed ( range ( r )): cycles [ i ] -= 1 if cycles [ i ] == 0 : indices [ i :] = indices [ i + 1 :] + indices [ i : i + 1 ] cycle... - https://man.mtool.work/python/3.14/library/itertools.html
- itertools --- 効率的なループ用のイテレータ生成関数群 — Python 3.14.8 ドキュメン... 9530
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 関数型プログラミング用モジュール » itertools --- 効率的なループ用のイテレータ生成関数群 テーマ 自動 ライト ダーク | itertools --- 効
...( pool ) if r > n : return indices = list ( range ( r )) yield tuple ( pool [ i ] for i in indices ) while True : for i in reversed ( range ( r )): if indices [ i ] != i + n - r : break else : return indices [ i ] += 1 for j in range ( i + 1 , r ): indic...len ( pool ) if not n and r : return indices = [ 0 ] * r yield tuple ( pool [ i ] for i in indices ) while True : for i in reversed ( range ( r )): if indices [ i ] != n - 1 : break else : return indices [ i :] = [ indices [ i ] + 1 ] * ( r - i ) yield t...nge ( n )) cycles = list ( range ( n , n - r , - 1 )) yield tuple ( pool [ i ] for i in indices [: r ]) while n : for i in reversed ( range ( r )): cycles [ i ] -= 1 if cycles [ i ] == 0 : indices [ i :] = indices [ i + 1 :] + indices [ i : i + 1 ] cycle... - https://man.mtool.work/python/3.14/library/itertools.html
- collections --- コンテナデータ型 — Python 3.14.8 ドキュメント 8728
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » collections --- コンテナデータ型 テーマ 自動 ライト ダーク | collections --- コンテナデータ型 ¶ ソースコード: Lib/collec
...の最大長で、制限されていなければ None です。 Added in version 3.1. 上記に加え、 deque はイテレーション, pickle 化, len(d) , reversed(d) , copy.copy(d) , copy.deepcopy(d) , in 演算子による包含の検査, d[0] のような添字による参照をサポートしています。添字によ...of the deque ['g', 'h', 'i'] >>> d [ 0 ] # peek at leftmost item 'g' >>> d [ - 1 ] # peek at rightmost item 'i' >>> list ( reversed ( d )) # list the contents of a deque in reverse ['i', 'h', 'g'] >>> 'h' in d # search the deque True >>> d . extend ( 'jk..., 'g', 'h', 'i', 'j', 'k']) >>> d . rotate ( - 1 ) # left rotation >>> d deque(['g', 'h', 'i', 'j', 'k', 'l']) >>> deque ( reversed ( d )) # make a new deque in reverse order deque(['l', 'k', 'j', 'i', 'h', 'g']) >>> d . clear () # empty the deque >>> d... - https://man.mtool.work/python/3.14/library/collections.html
- What's New in Python 2.4 — Python 3.14.8 ドキュメント 8728
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New in Python 2.4 テーマ 自動 ライト ダーク | What's New in Python 2.4 ¶ 著者 : A.M. Kuchling この文書は 2005 年 3 月 30 日にリリー
.../moin/PythonDecoratorLibrary 数多くのデコレータ例を含む Wiki ページ。 PEP 322: 逆順のイテレーション ¶ 新しいビルトイン関数 reversed(seq) は、シーケンスを受け取って、シーケンスの要素を逆順にループするイテレータを返します: >>> for i in reversed ( xrange (...1 , 4 )): ... print i ... 3 2 1 range(1,4)[::-1] のようにする拡張スライスでのやり方に比較して reversed() は読みやすく、実行が高速で、大体の場合はメモリ使用が少なく済みます。 reversed() は任意のイテレータは受け付けず、シーケン...レータを逆順にしたければ、最初に list() でリストに変換してください: >>> input = open ( '/etc/passwd' , 'r' ) >>> for line in reversed ( list ( input )): ... print line ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... 参考 PEP 322 - 逆順のイテレー... - https://man.mtool.work/python/3.14/whatsnew/2.4.html
- collections --- コンテナデータ型 — Python 3.14.8 ドキュメント 8728
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » collections --- コンテナデータ型 テーマ 自動 ライト ダーク | collections --- コンテナデータ型 ¶ ソースコード: Lib/collec
...の最大長で、制限されていなければ None です。 Added in version 3.1. 上記に加え、 deque はイテレーション, pickle 化, len(d) , reversed(d) , copy.copy(d) , copy.deepcopy(d) , in 演算子による包含の検査, d[0] のような添字による参照をサポートしています。添字によ...of the deque ['g', 'h', 'i'] >>> d [ 0 ] # peek at leftmost item 'g' >>> d [ - 1 ] # peek at rightmost item 'i' >>> list ( reversed ( d )) # list the contents of a deque in reverse ['i', 'h', 'g'] >>> 'h' in d # search the deque True >>> d . extend ( 'jk..., 'g', 'h', 'i', 'j', 'k']) >>> d . rotate ( - 1 ) # left rotation >>> d deque(['g', 'h', 'i', 'j', 'k', 'l']) >>> deque ( reversed ( d )) # make a new deque in reverse order deque(['l', 'k', 'j', 'i', 'h', 'g']) >>> d . clear () # empty the deque >>> d... - https://man.mtool.work/python/3.14/library/collections.html
- What's New in Python 2.4 — Python 3.14.8 ドキュメント 8728
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New in Python 2.4 テーマ 自動 ライト ダーク | What's New in Python 2.4 ¶ 著者 : A.M. Kuchling この文書は 2005 年 3 月 30 日にリリー
.../moin/PythonDecoratorLibrary 数多くのデコレータ例を含む Wiki ページ。 PEP 322: 逆順のイテレーション ¶ 新しいビルトイン関数 reversed(seq) は、シーケンスを受け取って、シーケンスの要素を逆順にループするイテレータを返します: >>> for i in reversed ( xrange (...1 , 4 )): ... print i ... 3 2 1 range(1,4)[::-1] のようにする拡張スライスでのやり方に比較して reversed() は読みやすく、実行が高速で、大体の場合はメモリ使用が少なく済みます。 reversed() は任意のイテレータは受け付けず、シーケン...レータを逆順にしたければ、最初に list() でリストに変換してください: >>> input = open ( '/etc/passwd' , 'r' ) >>> for line in reversed ( list ( input )): ... print line ... root:*:0:0:System Administrator:/var/root:/bin/tcsh ... 参考 PEP 322 - 逆順のイテレー... - https://man.mtool.work/python/3.14/whatsnew/2.4.html