per page, with , order by , clip by
Results of 1 - 10 of about 13 for PyMethodDef (0.008 sec.)
デスクリプタオブジェクト (descriptor object) 13372
デスクリプタオブジェクト (descriptor object) "デスクリプタ (descriptor)" は、あるオブジェクトのいくつかの属性について記述したオブジェクトです。デスクリプタオブジェクトは型オブジェクトの辞書内にあります。 PyTypeObject PyProperty_Type 次に属し ... ython の types.GetSetDescriptorType オブジェクトに対応します。 PyObject * PyDescr_NewMethod ( PyTypeObject * type , struct PyMethodDef * meth ) 戻り値: 新しい参照。 次に属します: Stable ABI . PyMethodDef 構造体 meth から、拡張型 type 用の新しいメソッドデスク ... 強参照 を返します。 失敗すると例外を設定して NULL を返します。 PyTypeObject PyMethodDescr_Type 次に属します: Stable ABI . PyMethodDef 構造体から作成されるメソッドデスクリプタオブジェクトの型オブジェクトです。 これらのデスクリプタは C 関数を型のメソッドとし ... tibility reasons. See PyCMethod_New() for wrapping a C function. PyObject * PyDescr_NewClassMethod ( PyTypeObject * type , PyMethodDef * method ) 戻り値: 新しい参照。 次に属します: Stable ABI . PyMethodDef 構造体 method から、拡張型 type 用の新しいクラスメソ ...
https://man.mtool.work/python/3.14/c-api/descriptor.html
モジュールオブジェクト (module object) 10135
モジュールオブジェクト (module object) PyTypeObject PyModule_Type 次に属します: Stable ABI . この PyTypeObject のインスタンスは Python のモジュール型を表します。 Python プログラムには types.ModuleType として公開されています。 int PyModule_C ... only allowed when using legacy single-phase initialization or when creating modules dynamically . 詳細は PEP 3121 を参照。 PyMethodDef * m_methods A pointer to a table of module-level functions, described by PyMethodDef values. Can be NULL if no functions a ... ー時には例外を設定して -1 、成功すると 0 を返します。 Added in version 3.9. int PyModule_AddFunctions ( PyObject * module , PyMethodDef * functions ) 次に属します: Stable ABI (バージョン 3.7 より). NULL で終端された functions 配列の関数を module に追加します ... 。 各エントリーの詳細は PyMethodDef のドキュメントを参照してください。 (C で実装するモジュールレベルの「関数」は、共有されるモジュール名前空間がないため、通常 ...
https://man.mtool.work/python/3.14/c-api/module.html
共通のオブジェクト構造体 (common object structure) 10135
共通のオブジェクト構造体 (common object structure) Python のオブジェクト型の定義には、多数の構造体が使われます。 この節では、それらの構造体と使い方を説明します。 基本のオブジェクト型とマクロ すべての Python オブジェクトは、メモリ上の表現の先 ... TypeObject * defining_class , PyObject * const * args , Py_ssize_t nargs , PyObject * kwnames ) Added in version 3.9. type PyMethodDef 次に属します: Stable ABI (すべてのメンバーを含む). 拡張型のメソッドを記述する際に用いる構造体です。この構造体には 4 つのフ ... ethod_CheckExact ( PyObject * op ) PyCMethod_Check() と同じですが、サブタイプは対象にしません。 PyObject * PyCMethod_New ( PyMethodDef * ml , PyObject * self , PyObject * module , PyTypeObject * cls ) 戻り値: 新しい参照。 次に属します: Stable ABI (バージョン ... CheckExact ( PyObject * op ) PyCFunction_Check() と同じですが、サブタイプは対象にしません。 PyObject * PyCFunction_NewEx ( PyMethodDef * ml , PyObject * self , PyObject * module ) 戻り値: 新しい参照。 次に属します: Stable ABI . PyCMethod_New(ml, self, modul ...
https://man.mtool.work/python/3.14/c-api/structures.html
3. 拡張の型の定義: 雑多なトピック 10135
3. 拡張の型の定義: 雑多なトピック この節ではさまざまな実装可能なタイプメソッドと、それらが何をするものであるかについて、ざっと説明します。 以下は PyTypeObject の定義です。 デバッグビルド でしか使われないいくつかのメンバは省いてあります: typ ... ffset ; /* イテレータ */ getiterfunc tp_iter ; iternextfunc tp_iternext ; /* 属性デスクリプタとサブクラス化に関するもの */ PyMethodDef * tp_methods ; PyMemberDef * tp_members ; PyGetSetDef * tp_getset ; // ヒープ型では強参照、静的な型では借用参照 PyTypeObje ... tp_setattro フィールドも NULL にしてください。 テーブルはタイプオブジェクト中の 3つのメンバとして宣言されています: struct PyMethodDef * tp_methods ; struct PyMemberDef * tp_members ; struct PyGetSetDef * tp_getset ; tp_methods が NULL でない場合は、 PyMeth ... odDef 構造体の配列を指す必要があります。 テーブル内の各エントリーは、次の構造体のインスタンスです。 typedef struct PyMethodDef { const char * ml_name ; /* メソッド名 */ PyCFunction ml_meth ; /* 実装関数 */ int ml_flags ; /* フラグ */ const char * ml ...
https://man.mtool.work/python/3.14/extending/newtypes.html
2. 拡張の型の定義: チュートリアル 9325
2. 拡張の型の定義: チュートリアル Python では、組み込みの str 型や list 型のような Python コードから操作できる新しい型を C 拡張モジュールの作者が定義できます。 全ての拡張の型のコードはあるパターンに従うのですが、書き始める前に理解しておくべ ... ttributeError , "last" ); return NULL ; } return PyUnicode_FromFormat ( "%S %S" , self -> first , self -> last ); } static PyMethodDef Custom_methods [] = { { "name" , Custom_name , METH_NOARGS , "ファーストネームとラストネームを連結した名前を返す" }, { NUL ... う。 次の節でその方法を説明します。 さて、メソッドを定義したので、ここでメソッド定義用の配列を作成する必要があります: static PyMethodDef Custom_methods [] = { { "name" , Custom_name , METH_NOARGS , "ファーストネームとラストネームを連結した名前を返す" }, { NUL ... omObject * self = ( CustomObject * ) op ; return PyUnicode_FromFormat ( "%S %S" , self -> first , self -> last ); } static PyMethodDef Custom_methods [] = { { "name" , Custom_name , METH_NOARGS , "ファーストネームとラストネームを連結した名前を返す" }, { NUL ...
https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
型ヒントのためのオブジェクト 9061
型ヒントのためのオブジェクト 型ヒント用の組み込み型を提供しています。 現在は GenericAlias と Union の二つがあり、このうち C に公開されているのは GenericAlias だけです。 PyObject * Py_GenericAlias ( PyObject * origin , PyObject * args ) 次に ... 応じて遅延生成されます。失敗した場合、例外が送出されて NULL を返します。 拡張型をジェネリックにする例を示します。 ... static PyMethodDef my_obj_methods [] = { // ほかのメソッド。 ... { "__class_getitem__" , Py_GenericAlias , METH_O | METH_CLASS , "my_obj は格 ...
https://man.mtool.work/python/3.14/c-api/typehints.html
型オブジェクトの構造体 7988
型オブジェクトの構造体 新しい型を定義する PyTypeObject 構造体は、Python のオブジェクトシステムで特に重要な構造体の 1 つです。 型オブジェクトは PyObject_* 関数や PyType_* 関数で扱えますが、ほとんどの Python アプリケーションにとって関心のある ... e__ X G ( tp_weaklistoffset ) Py_ssize_t X ? tp_iter getiterfunc __iter__ X tp_iternext iternextfunc __next__ X tp_methods PyMethodDef [] X X tp_members PyMemberDef [] X tp_getset PyGetSetDef [] X X tp_base PyTypeObject * __base__ X tp_dict PyObject * __dic ... ffset ; /* イテレータ */ getiterfunc tp_iter ; iternextfunc tp_iternext ; /* 属性デスクリプタとサブクラス化に関するもの */ PyMethodDef * tp_methods ; PyMemberDef * tp_members ; PyGetSetDef * tp_getset ; // ヒープ型では強参照、静的な型では借用参照 PyTypeObje ... 返さねばなりません。 この関数のシグネチャは PyIter_Next() と同じです。 継承: サブタイプはこのフィールドを継承します。 struct PyMethodDef * PyTypeObject . tp_methods The corresponding slot ID Py_tp_methods is part of the Stable ABI . オプションのポインタで、こ ...
https://man.mtool.work/python/3.14/c-api/typeobj.html
はじめに 7706
はじめに Python のアプリケーションプログラマー向けインターフェース (API) は、C と C++ のプログラマーに、Python インタープリタへのさまざまなレベルのアクセスを提供します。 C++ からも同様に使えますが、簡潔に Python/C API と呼びます。 Python/C ... は空文字列になります。 以下はプログラム例です: PyDoc_STRVAR ( pop_doc , "Remove and return the rightmost element." ); static PyMethodDef deque_methods [] = { // ... { "pop" , ( PyCFunction ) deque_pop , METH_NOARGS , pop_doc }, // ... } PyDoc_VAR( name ) = Py ... に展開されます。 docstring が無効な場合 ( --without-doc-strings ) は空文字列に展開されます。 以下はプログラム例です: static PyMethodDef pysqlite_row_methods [] = { { "keys" , ( PyCFunction ) pysqlite_row_keys , METH_NOARGS , PyDoc_STR ( "Returns the keys of ...
https://man.mtool.work/python/3.14/c-api/intro.html
C API Stability 7442
C API Stability 特記のない限り、Python の C API には後方互換性ポリシー PEP 387 が適用されます。 変更の大半はソース互換性を保ちます (通常は新しい API の追加だけを行います)。 既存 API の変更や削除は、非推奨の期間を経た後、または重大な問題を修 ... MemoryView_FromBuffer() PyMemoryView_FromMemory() PyMemoryView_FromObject() PyMemoryView_GetContiguous() PyMemoryView_Type PyMethodDef PyMethodDescr_Type PyModuleDef PyModuleDef_Base PyModuleDef_Init() PyModuleDef_Slot PyModuleDef_Type PyModule_Add() PyModu ...
https://man.mtool.work/python/3.14/c-api/stable.html
1. 他のアプリケーションへの Python の埋め込み 7442
1. 他のアプリケーションへの Python の埋め込み 前章では、 Python を拡張する方法、すなわち C 関数のライブラリを Python に結びつけて機能を拡張する方法について述べました。同じようなことを別の方法でも実行できます: それは、自分の C/C++ アプリケー ... bject * args ) { if ( ! PyArg_ParseTuple ( args , ":numargs" )) return NULL ; return PyLong_FromLong ( numargs ); } static PyMethodDef emb_module_methods [] = { { "numargs" , emb_numargs , METH_VARARGS , "プロセスが受け取った引数の数を返します。" }, { NULL ...
https://man.mtool.work/python/3.14/extending/embedding.html
PREV 1 2 NEXT