Results of 1 - 10 of about 118 for getattr (0.014 sec.)
- デスクリプタ ガイド — Python 3.14.8 ドキュメント 10764
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » デスクリプタ ガイド テーマ 自動 ライト ダーク | デスクリプタ ガイド ¶ Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を
..., name ): self . public_name = name self . private_name = '_' + name def __get__ ( self , obj , objtype = None ): value = getattr ( obj , self . private_name ) logging . info ( 'Accessing %r giving %r ' , self . public_name , value ) return value def _...__set_name__ ( self , owner , name ): self . private_name = '_' + name def __get__ ( self , obj , objtype = None ): return getattr ( obj , self . private_name ) def __set__ ( self , obj , value ): self . validate ( value ) setattr ( obj , self . private...iptors the highest priority, followed by instance variables, then non-data descriptors, then class variables, and lastly __getattr__() if it is provided. a.x に対するデスクリプタが見つかった場合、 desc.__get__(a, type(a)) という形式で呼び出されます。 ド... - https://man.mtool.work/python/3.14/howto/descriptor.html
- デスクリプタ ガイド — Python 3.14.8 ドキュメント 10764
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » デスクリプタ ガイド テーマ 自動 ライト ダーク | デスクリプタ ガイド ¶ Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を
..., name ): self . public_name = name self . private_name = '_' + name def __get__ ( self , obj , objtype = None ): value = getattr ( obj , self . private_name ) logging . info ( 'Accessing %r giving %r ' , self . public_name , value ) return value def _...__set_name__ ( self , owner , name ): self . private_name = '_' + name def __get__ ( self , obj , objtype = None ): return getattr ( obj , self . private_name ) def __set__ ( self , obj , value ): self . validate ( value ) setattr ( obj , self . private...iptors the highest priority, followed by instance variables, then non-data descriptors, then class variables, and lastly __getattr__() if it is provided. a.x に対するデスクリプタが見つかった場合、 desc.__get__(a, type(a)) という形式で呼び出されます。 ド... - https://man.mtool.work/python/3.14/howto/descriptor.html
- オブジェクトプロトコル (object protocol) — Python 3.14.8 ドキュメント 9242
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » オブジェクトプロトコル (object protocol) テーマ 自動 ライト ダーク | オブジェク
...has the attribute attr_name , and 0 otherwise. This function always succeeds. 注釈 Exceptions that occur when this calls __getattr__() and __getattribute__() methods aren't propagated, but instead given to sys.unraisablehook() . For proper error handlin...g, use PyObject_HasAttrWithError() , PyObject_GetOptionalAttr() or PyObject_GetAttr() instead. int PyObject_HasAttrString ( PyObject * o , const char * attr_name ) ¶ 次に属します: Stable ABI . This is the s...fied as a const char * UTF-8 encoded bytes string, rather than a PyObject * . 注釈 Exceptions that occur when this calls __getattr__() and __getattribute__() methods or while creating the temporary str object are silently ignored. For proper error handl... - https://man.mtool.work/python/3.14/c-api/object.html
- Type Object Structures — Python 3.14.8 ドキュメント 9242
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » オブジェクト実装サポート (object implementation support) » Type Object Structures テーマ 自動 ライト ダーク | Type Object Structu
...basicsize Py_ssize_t X X X tp_itemsize Py_ssize_t X X tp_dealloc destructor X X X tp_vectorcall_offset Py_ssize_t X X ( tp_getattr ) getattrfunc __getattribute__, __getattr__ G ( tp_setattr ) setattrfunc __setattr__, __delattr__ G tp_as_async PyAsyncMet...MappingMethods * sub-slots % tp_hash hashfunc __hash__ X G tp_call ternaryfunc __call__ X X tp_str reprfunc __str__ X X tp_getattro getattrofunc __getattribute__, __getattr__ X X G tp_setattro setattrofunc __setattr__, __delattr__ X X G tp_as_buffer PyB...TypeObject * PyObject * PyObject * PyObject * initproc PyObject * PyObject * PyObject * int reprfunc PyObject * PyObject * getattrfunc PyObject * const char * PyObject * setattrfunc PyObject * const char * PyObject * int getattrofunc PyObject * PyObject... - https://man.mtool.work/python/3.14/c-api/typeobj.html
- 3. データモデル — Python 3.14.8 ドキュメント 9242
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python 言語リファレンス » 3. データモデル テーマ 自動 ライト ダーク | 3. データモデル ¶ 3.1. オブジェクト、値、および型 ¶ Objects are Python's abstraction for da
...from the objects actually stored in the class's __dict__ . If no class attribute is found, and the object's class has a __getattr__() method, that is called to satisfy the lookup. 属性の代入や削除を行うと、インスタンスの辞書を更新しますが、クラスの辞書...e frame. f_code ¶ The code object being executed in this frame. Accessing this attribute raises an auditing event object.__getattr__ with arguments obj and "f_code" . frame. f_locals ¶ The mapping used by the frame to look up local variables . If the fr...tb_frame ¶ Points to the execution frame of the current level. Accessing this attribute raises an auditing event object.__getattr__ with arguments obj and "tb_frame" . traceback. tb_lineno ¶ Gives the line number where the exception occurred traceback.... - https://man.mtool.work/python/3.14/reference/datamodel.html
- Type Object Structures — Python 3.14.8 ドキュメント 9080
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » オブジェクト実装サポート (object implementation support) » Type Object Structures テーマ 自動 ライト ダーク | Type Object Structu
...basicsize Py_ssize_t X X X tp_itemsize Py_ssize_t X X tp_dealloc destructor X X X tp_vectorcall_offset Py_ssize_t X X ( tp_getattr ) getattrfunc __getattribute__, __getattr__ G ( tp_setattr ) setattrfunc __setattr__, __delattr__ G tp_as_async PyAsyncMet...MappingMethods * sub-slots % tp_hash hashfunc __hash__ X G tp_call ternaryfunc __call__ X X tp_str reprfunc __str__ X X tp_getattro getattrofunc __getattribute__, __getattr__ X X G tp_setattro setattrofunc __setattr__, __delattr__ X X G tp_as_buffer PyB...TypeObject * PyObject * PyObject * PyObject * initproc PyObject * PyObject * PyObject * int reprfunc PyObject * PyObject * getattrfunc PyObject * const char * PyObject * setattrfunc PyObject * const char * PyObject * int getattrofunc PyObject * PyObject... - https://man.mtool.work/python/3.14/c-api/typeobj.html
- 3. データモデル — Python 3.14.8 ドキュメント 9080
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python 言語リファレンス » 3. データモデル テーマ 自動 ライト ダーク | 3. データモデル ¶ 3.1. オブジェクト、値、および型 ¶ Objects are Python's abstraction for da
...from the objects actually stored in the class's __dict__ . If no class attribute is found, and the object's class has a __getattr__() method, that is called to satisfy the lookup. 属性の代入や削除を行うと、インスタンスの辞書を更新しますが、クラスの辞書...e frame. f_code ¶ The code object being executed in this frame. Accessing this attribute raises an auditing event object.__getattr__ with arguments obj and "f_code" . frame. f_locals ¶ The mapping used by the frame to look up local variables . If the fr...tb_frame ¶ Points to the execution frame of the current level. Accessing this attribute raises an auditing event object.__getattr__ with arguments obj and "tb_frame" . traceback. tb_lineno ¶ Gives the line number where the exception occurred traceback.... - https://man.mtool.work/python/3.14/reference/datamodel.html
- アノテーションのベストプラクティス — Python 3.14.8 ドキュメント 9080
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python HOWTO » アノテーションのベストプラクティス テーマ 自動 ライト ダーク | アノテーションのベストプラクティス ¶ author : Larry Hastings 概要 このドキュメントは
...tations__ 属性が定義されていない可能性があります。この属性があるかどうか不明なオブジェクトの場合は、Python 3.10 以降では、 getattr() に3つの引数を渡して呼び出す (例えば getattr(o, '__annotations__', None) ) のを推奨します。 Python 3.10 より前のバージョン...数や他の callable、モジュール) のアノテーションを取得する推奨の方法は、3.10と同じです。 inspect.get_annotations() ではなく、 getattr() に3つの引数を渡すことで __annotations__ 属性を取得するのがいいです。 ただし、クラスについては推奨方法が異なります。なぜな...安全に取得することができます: if isinstance ( o , type ): ann = o . __dict__ . get ( '__annotations__' , None ) else : ann = getattr ( o , '__annotations__' , None ) このコードを実行すると、 ann の値は辞書か None となります。さらに ann の値を調べるには、... - https://man.mtool.work/python/3.14/howto/annotations.html
- オブジェクトプロトコル (object protocol) — Python 3.14.8 ドキュメント 8731
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » オブジェクトプロトコル (object protocol) テーマ 自動 ライト ダーク | オブジェク
...has the attribute attr_name , and 0 otherwise. This function always succeeds. 注釈 Exceptions that occur when this calls __getattr__() and __getattribute__() methods aren't propagated, but instead given to sys.unraisablehook() . For proper error handlin...g, use PyObject_HasAttrWithError() , PyObject_GetOptionalAttr() or PyObject_GetAttr() instead. int PyObject_HasAttrString ( PyObject * o , const char * attr_name ) ¶ 次に属します: Stable ABI . This is the s...fied as a const char * UTF-8 encoded bytes string, rather than a PyObject * . 注釈 Exceptions that occur when this calls __getattr__() and __getattribute__() methods or while creating the temporary str object are silently ignored. For proper error handl... - https://man.mtool.work/python/3.14/c-api/object.html
- inspect --- 活動中のオブジェクトを調査する — Python 3.14.8 ドキュメント 8731
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » inspect --- 活動中のオブジェクトを調査する テーマ 自動 ライト ダーク | inspect --- 活動中のオブジェクト
..., predicate ] ) ¶ オブジェクトの全てのメンバーを (name, value) ペアのリストで返します。ただし、デスクリプタプロトコルの __getattr__ や __getattribute__ を介した動的なルックアップは行いません。オプションとして、引数に与えられた predicate を満たすメンバー...ストが返されます。 バージョン 3.11 で変更: FrameInfo オブジェクトのリストが返されるようになりました。 属性の静的なフェッチ ¶ getattr() や hasattr() は属性の存在確認や属性値の取得に際してコードの実行を伴うことがあります。プロパティなどのデスクリプタが呼び出...され、また __getattr__() や __getattribute__() が呼び出されたりするかもしれません。 For cases where you want passive introspection, like docume... - https://man.mtool.work/python/3.14/library/inspect.html