Results of 1 - 3 of about 3 for MethodType (0.003 sec.)
- デスクリプタ ガイド 11012
- デスクリプタ ガイド Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を使うと、オブジェクトの属性の検索、保存、削除をカスタマイズできます。 本ガイドは4つの大項目から構成されています。 最初の「入門」では基本の紹介をし
...習上、このインスタンスの引数名は self ですが、 this などの別の名前でも構いません。 メソッドは、ほぼ次のコードと同等な types.MethodType を使えば手動で作れます。 class MethodType : "Objects/classobject.c の PyMethod_Type を模擬する" def __init__ ( self , func...( self , obj , objtype = None ): "Objects/funcobject.c の func_descr_get() を模擬する" if obj is None : return self return MethodType ( self , obj ) 次のクラスをインタープリタで実行すると、関数デスクリプタが実際にどう動くかを確認できます。 class D : def f...unctools . update_wrapper ( self , f ) def __get__ ( self , obj , cls = None ): if cls is None : cls = type ( obj ) return MethodType ( self . f , cls ) ClassMethod 内の functools.update_wrapper() の呼び出しは、根底にある関数を参照する __wrapped__ 属性を追... - https://man.mtool.work/python/3.14/howto/descriptor.html
- インスタンスメソッドオブジェクト(Instance Method Objects) 10156
- インスタンスメソッドオブジェクト(Instance Method Objects) インスタンスメソッドは PyCFunction のラッパーであり、 PyCFunction をクラスオブジェクトに束縛する新しい方法です。 以前の PyMethod_New(func, NULL, class) 呼び出しに代わるものです。 PyT
...PyTypeObject PyMethod_Type この PyTypeObject のインスタンスは Python のメソッド型を表現します。このオブジェクトは、 types.MethodType として Python プログラムに公開されています。 int PyMethod_Check ( PyObject * o ) o がメソッドオブジェクト ( PyMethod_Type... - https://man.mtool.work/python/3.14/c-api/method.html
- types --- 動的な型生成と組み込み型の名前 6715
- types --- 動的な型生成と組み込み型の名前 ソースコード: Lib/types.py このモジュールは新しい型の動的な生成を支援するユーティリティ関数を定義します。 さらに、標準の Python インタプリタによって使用されているものの、 int や str のように組み込みと
...の型です。 セルオブジェクトは、関数の クロージャ変数 を格納するコンテナとして使われます。 Added in version 3.8. class types. MethodType ユーザー定義のクラスのインスタンスのメソッドの型です。 class types. BuiltinFunctionType class types. BuiltinMethodType len... - https://man.mtool.work/python/3.14/library/types.html
PREV
1
NEXT