Results of 1 - 10 of about 164 for define (0.011 sec.)
- 1. Extending Python with C or C++ — Python 3.14.8 ドキュメント 10166
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python インタプリタの拡張と埋め込み » 1. Extending Python with C or C++ テーマ 自動 ライト ダーク | 1. Extending Python with C or C++ ¶ It is quite easy to add n
...y can call C library functions and system calls. To support extensions, the Python API (Application Programmers Interface) defines a set of functions, macros and variables that provide access to most aspects of the Python run-time system. The Python AP...dule name is very long, like spammify , the module name can be just spammify.c .) The first two lines of our file can be: #define PY_SSIZE_T_CLEAN #include <Python.h> which pulls in the Python API (you can add a comment describing the purpose of the mo...dule and a copyright notice if you like). 注釈 Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any sta... - https://man.mtool.work/python/3.14/extending/extending.html
- __main__ --- トップレベルのコード環境 — Python 3.14.8 ドキュメント 10166
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » __main__ --- トップレベルのコード環境 テーマ 自動 ライト ダーク | __main__ --- トップレベルのコード環境
...name '__main__' . Here is an example module that consumes the __main__ namespace: # namely.py import __main__ def did_user_define_their_name (): return 'my_name' in dir ( __main__ ) def print_user_name (): if not did_user_define_their_name (): raise Va...lueError ( 'Define the variable `my_name`!' ) print ( __main__ . my_name ) Example usage of this module could be as follows: # start.py impor..._ == "__main__" : sys . exit ( main ()) Now, if we started our program, the result would look like this: $ python start.py Define the variable `my_name`! The exit code of the program would be 1, indicating an error. Uncommenting the line with my_name =... - https://man.mtool.work/python/3.14/library/__main__.html
- 1. Extending Python with C or C++ — Python 3.14.8 ドキュメント 10166
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python インタプリタの拡張と埋め込み » 1. Extending Python with C or C++ テーマ 自動 ライト ダーク | 1. Extending Python with C or C++ ¶ It is quite easy to add n
...y can call C library functions and system calls. To support extensions, the Python API (Application Programmers Interface) defines a set of functions, macros and variables that provide access to most aspects of the Python run-time system. The Python AP...dule name is very long, like spammify , the module name can be just spammify.c .) The first two lines of our file can be: #define PY_SSIZE_T_CLEAN #include <Python.h> which pulls in the Python API (you can add a comment describing the purpose of the mo...dule and a copyright notice if you like). 注釈 Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any sta... - https://man.mtool.work/python/3.14/extending/extending.html
- __main__ --- トップレベルのコード環境 — Python 3.14.8 ドキュメント 10166
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » __main__ --- トップレベルのコード環境 テーマ 自動 ライト ダーク | __main__ --- トップレベルのコード環境
...name '__main__' . Here is an example module that consumes the __main__ namespace: # namely.py import __main__ def did_user_define_their_name (): return 'my_name' in dir ( __main__ ) def print_user_name (): if not did_user_define_their_name (): raise Va...lueError ( 'Define the variable `my_name`!' ) print ( __main__ . my_name ) Example usage of this module could be as follows: # start.py impor..._ == "__main__" : sys . exit ( main ()) Now, if we started our program, the result would look like this: $ python start.py Define the variable `my_name`! The exit code of the program would be 1, indicating an error. Uncommenting the line with my_name =... - https://man.mtool.work/python/3.14/library/__main__.html
- copy --- 浅いコピーおよび深いコピー操作 — Python 3.14.8 ドキュメント 9163
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » copy --- 浅いコピーおよび深いコピー操作 テーマ 自動 ライト ダーク | copy --- 浅いコピーおよび深いコピー操作 ¶ ソースコー
...se methods. In fact, the copy module uses the registered pickle functions from the copyreg module. In order for a class to define its own copy implementation, it can define special methods __copy__() and __deepcopy__() . object. __copy__ ( self ) ¶ Cal...han copy() and deepcopy() , and only supports named tuples created by namedtuple() , dataclasses , and other classes which define method __replace__() . object. __replace__ ( self , / , ** changes ) ¶ This method should create a new object of the same...関連キーワード コピー copy deepcopy deep memo 操作 shallow replace changes type 複合 pickle method methods instance module define self argument dictionary 代入 ミュータブル コレクション replacing fields 前のトピックへ types --- 動的な型生成と組み込み型... - https://man.mtool.work/python/3.14/library/copy.html
- What's New in Python 2.2 — Python 3.14.8 ドキュメント 8958
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New in Python 2.2 テーマ 自動 ライト ダーク | What's New in Python 2.2 ¶ 著者 : A.M. Kuchling はじめに ¶ この文書は 2002 年 10 月 1
...d __methods__ attributes that were lists of names, but often the author of an extension type or a class wouldn't bother to define them. You could fall back on inspecting the __dict__ of an object, but when class inheritance or an arbitrary __getattr__(...gular functions. Class methods are passed the class of the object, but not the object itself. Static and class methods are defined like this: class C ( object ): def f ( arg1 , arg2 ): ... f = staticmethod ( f ) def g ( cls , arg1 , arg2 ): ... g = cla...cial syntax for creating such methods ( def static f , defstatic f() , or something like that) but no such syntax has been defined yet; that's been left for future versions of Python. スロットとプロパティのような新機能がさらに新種のデスクリプタとして実... - https://man.mtool.work/python/3.14/whatsnew/2.2.html
- What's New in Python 2.2 — Python 3.14.8 ドキュメント 8958
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New in Python 2.2 テーマ 自動 ライト ダーク | What's New in Python 2.2 ¶ 著者 : A.M. Kuchling はじめに ¶ この文書は 2002 年 10 月 1
...d __methods__ attributes that were lists of names, but often the author of an extension type or a class wouldn't bother to define them. You could fall back on inspecting the __dict__ of an object, but when class inheritance or an arbitrary __getattr__(...gular functions. Class methods are passed the class of the object, but not the object itself. Static and class methods are defined like this: class C ( object ): def f ( arg1 , arg2 ): ... f = staticmethod ( f ) def g ( cls , arg1 , arg2 ): ... g = cla...cial syntax for creating such methods ( def static f , defstatic f() , or something like that) but no such syntax has been defined yet; that's been left for future versions of Python. スロットとプロパティのような新機能がさらに新種のデスクリプタとして実... - https://man.mtool.work/python/3.14/whatsnew/2.2.html
- 2. 拡張の型の定義: チュートリアル — Python 3.14.8 ドキュメント 8354
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python インタプリタの拡張と埋め込み » 2. 拡張の型の定義: チュートリアル テーマ 自動 ライト ダーク | 2. 拡張の型の定義: チュートリアル ¶ Python では、組み込みの s
...ype_FromSpec() 関数を使い、ヒープ上に配置された拡張の型も定義できますが、これについてはこのチュートリアルでは扱いません。 #define PY_SSIZE_T_CLEAN #include <Python.h> typedef struct { PyObject_HEAD /* Type-specific fields go here. */ } CustomObject ; s...数ポインタの集まりを定義しています。特定の操作が要求されたときに、この関数ポインタをインタープリターが見に行きます。 How to define and execute the custom module: this is the PyInit_custom function and the associated custom_module struct for defining the...に、この型を基底クラスとしても利用できるようにします。ここでは新しいモジュール custom2 をつくり、これらの機能を追加します: #define PY_SSIZE_T_CLEAN #include <Python.h> #include <stddef.h> /* for offsetof() */ typedef struct { PyObject_HEAD PyObject * fi... - https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
- 2. 拡張の型の定義: チュートリアル — Python 3.14.8 ドキュメント 8354
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python インタプリタの拡張と埋め込み » 2. 拡張の型の定義: チュートリアル テーマ 自動 ライト ダーク | 2. 拡張の型の定義: チュートリアル ¶ Python では、組み込みの s
...ype_FromSpec() 関数を使い、ヒープ上に配置された拡張の型も定義できますが、これについてはこのチュートリアルでは扱いません。 #define PY_SSIZE_T_CLEAN #include <Python.h> typedef struct { PyObject_HEAD /* Type-specific fields go here. */ } CustomObject ; s...数ポインタの集まりを定義しています。特定の操作が要求されたときに、この関数ポインタをインタープリターが見に行きます。 How to define and execute the custom module: this is the PyInit_custom function and the associated custom_module struct for defining the...に、この型を基底クラスとしても利用できるようにします。ここでは新しいモジュール custom2 をつくり、これらの機能を追加します: #define PY_SSIZE_T_CLEAN #include <Python.h> #include <stddef.h> /* for offsetof() */ typedef struct { PyObject_HEAD PyObject * fi... - https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
- copy --- 浅いコピーおよび深いコピー操作 — Python 3.14.8 ドキュメント 7955
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » copy --- 浅いコピーおよび深いコピー操作 テーマ 自動 ライト ダーク | copy --- 浅いコピーおよび深いコピー操作 ¶ ソースコー
...se methods. In fact, the copy module uses the registered pickle functions from the copyreg module. In order for a class to define its own copy implementation, it can define special methods __copy__() and __deepcopy__() . object. __copy__ ( self ) ¶ Cal...han copy() and deepcopy() , and only supports named tuples created by namedtuple() , dataclasses , and other classes which define method __replace__() . object. __replace__ ( self , / , ** changes ) ¶ This method should create a new object of the same... - https://man.mtool.work/python/3.14/library/copy.html