Results of 1 - 8 of about 8 for fromkeys (0.009 sec.)
- スレッドセーフ性の保証 13411
- スレッドセーフ性の保証 このページでは、Python のフリースレッドビルドにおける組み込み型のスレッドセーフ性の保証を説明します。 ここで説明する保証は、 GIL を無効にして Python を使う場合 (フリースレッドモード) に適用されます。 GIL が有効な場合、
...eating a dictionary with the dict constructor is atomic when the argument to it is a dict or a tuple . When using the dict.fromkeys() method, dictionary creation is atomic when the argument is a dict , tuple , set or frozenset . The following operations...合は比較中にロックを解放することがあります。 イテラブルが dict 、 set 、 frozenset そのもの (サブクラスは除く) である場合、 fromkeys() は新しい辞書とそのイテラブルの両方をロックします。 dict . fromkeys ( a_dict ) # 両方をロックする dict . fromkeys ( a_set...) # 両方をロックする dict . fromkeys ( a_frozenset ) # 両方をロックする 辞書ではないイテラブルから更新する場合、更新先の辞書だけをロックします。 イテラブルは、... - https://man.mtool.work/python/3.14/builtins/threadsafety.html
- デスクリプタ ガイド 10157
- デスクリプタ ガイド Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を使うと、オブジェクトの属性の検索、保存、削除をカスタマイズできます。 本ガイドは4つの大項目から構成されています。 最初の「入門」では基本の紹介をし
...ないときに便利です。クラスメソッドの使い方の一つは、代わりのクラスコンストラクタを作ることです。例えば、クラスメソッド dict.fromkeys() は新しい辞書をキーのリストから生成します。等価な pure Python 版は: class Dict ( dict ): @classmethod def fromkeys ( cls..., iterable , value = None ): "Objects/dictobject.c の dict_fromkeys() を模擬する" d = cls () for key in iterable : d [ key ] = value return d これで一意なキーを持つ新しい辞書が以下のように構...成できます: >>> d = Dict . fromkeys ( 'abracadabra' ) >>> type ( d ) is Dict True >>> d {'a': None, 'b': None, 'r': None, 'c': None, 'd': None} 非データデスク... - https://man.mtool.work/python/3.14/howto/descriptor.html
- collections --- コンテナデータ型 8549
- collections --- コンテナデータ型 ソースコード: Lib/collections/__init__.py このモジュールは、汎用の Python 組み込みコンテナ dict , list , set , および tuple に代わる、特殊なコンテナデータ型を実装しています。 namedtuple() 名前付きフィールドを
...n 3.10. The usual dictionary methods are available for Counter objects except for two which work differently for counters. fromkeys ( iterable ) このクラスメソッドは Counter オブジェクトには実装されていません。 update ( ** kwargs ) update ( iterable , /...す。また last が偽の場合には先頭に移動します。指定した key が存在しない場合は KeyError を送出します。 >>> d = OrderedDict . fromkeys ( 'abcde' ) >>> d . move_to_end ( 'b' ) >>> '' . join ( d ) 'acdeb' >>> d . move_to_end ( 'b' , last = False ) >>> '' . jo... - https://man.mtool.work/python/3.14/library/collections.html
- types --- 動的な型生成と組み込み型の名前 8549
- types --- 動的な型生成と組み込み型の名前 ソースコード: Lib/types.py このモジュールは新しい型の動的な生成を支援するユーティリティ関数を定義します。 さらに、標準の Python インタプリタによって使用されているものの、 int や str のように組み込みと
...など、一部の組み込みデータ型のメソッドの型です。 Added in version 3.7. class types. ClassMethodDescriptorType dict.__dict__['fromkeys'] など、一部の組み込みデータ型の 束縛されていない クラスメソッドの型です。 Added in version 3.7. class types. ModuleType (... - https://man.mtool.work/python/3.14/library/types.html
- What's New in Python 2.3 7898
- What's New in Python 2.3 著者 : A.M. Kuchling この文書は Python 2.3 の新機能について解説します。Python 2.3 は 2003 年 7 月 29 日にリリースされました。 Python 2.3 の主要なテーマは、2.2 で追加されたいくつかの機能を磨くこと、言語中核に小さいな
...nt call last): File "stdin" , line 1 , in ? KeyError : 'pop(): dictionary is empty' >>> d {} >>> また、新しいメソッド dict.fromkeys(iterable, value) は、与えられたイテレータ iterable からキーを取り出しつつ全ての値を value にセットすることで構築します。 v... - https://man.mtool.work/python/3.14/whatsnew/2.3.html
- What's New In Python 3.11 7898
- What's New In Python 3.11 編集者 : Pablo Galindo Salgado この記事では Python 3.10 と比較した Python 3.11 の新機能を解説します。Python 3.11 は2022年10月24日にリリースされました。全詳細については 変更履歴 をご覧ください。 概要 -- リリースハイ
...書はハッシュ値を保存しなくなり、 dict のサイズが小さくなりました。 例えば、64 ビットプラットフォームでの sys.getsizeof(dict.fromkeys("abcdefg")) は、352 バイトから 272 バイトに減りました (23% 削減)。 (Inada Naoki による bpo-46845 での貢献。) asyncio.Datag... - https://man.mtool.work/python/3.14/whatsnew/3.11.html
- What's new in Python 3.14 7898
- What's new in Python 3.14 エディタ : Adam Turner と Hugo van Kemenade この記事では Python 3.13 と比較した Python 3.14 の新機能を解説します。Python 3.14 は2025年10月7日にリリースされました。全詳細については 変更履歴 をご覧ください。 参考 PEP
...キシオブジェクト に、これまで見落とされていたメソッドを追加しました。 list のプロキシに clear() と copy() dict のプロキシに fromkeys() 、 reversed(d) 、 d | {} 、 {} | d 、 d |= {'b': 2} (Roy Hyunjin Han が gh-103134 で貢献しました。) SyncManager.set() を... - https://man.mtool.work/python/3.14/whatsnew/3.14.html
- What's New In Python 3.2 7898
- What's New In Python 3.2 著者 : Raymond Hettinger この記事では Python 3.1 と比較した Python 3.2 の新機能を説明します。 Python 3.2 は 2011 年 2 月 20 日にリリースされました。 主な変更点をいくつか取り上げ、例を示します。 すべての詳細については
...よってアクセス順を追跡するのに、順序付けされた辞書を使えます。 >>> from collections import OrderedDict >>> d = OrderedDict . fromkeys ([ 'a' , 'b' , 'X' , 'd' , 'e' ]) >>> list ( d ) ['a', 'b', 'X', 'd', 'e'] >>> d . move_to_end ( 'X' ) >>> list ( d ) ['a'... - https://man.mtool.work/python/3.14/whatsnew/3.2.html
PREV
1
NEXT