Results of 1 - 10 of about 82 for setitem (0.005 sec.)
- リストオブジェクト — Python 3.14.8 ドキュメント 11551
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » リストオブジェクト テーマ 自動 ライト ダーク | リストオブジェクト ¶ type PyListObject
...han zero, the returned list object's items are set to NULL . Thus you cannot use abstract API functions such as PySequence_SetItem() or expose the object to Python code before setting all items to a real object with PyList_SetItem() or PyList_SET_ITEM().... The following APIs are safe APIs before the list is fully initialized: PyList_SetItem() and PyList_SET_ITEM() . Py_ssize_t PyList_Size ( PyObject * list ) ¶ 次に属します: Stable ABI . Thread safety: Atomic ....another thread modifies the list concurrently. Prefer PyList_GetItemRef() , which returns a strong reference . int PyList_SetItem ( PyObject * list , Py_ssize_t index , PyObject * item ) ¶ 次に属します: Stable ABI . Thread safety: Atomic . リストオブジ... - https://man.mtool.work/python/3.14/c-api/list.html
- リストオブジェクト — Python 3.14.8 ドキュメント 10775
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » リストオブジェクト テーマ 自動 ライト ダーク | リストオブジェクト ¶ type PyListObject
...han zero, the returned list object's items are set to NULL . Thus you cannot use abstract API functions such as PySequence_SetItem() or expose the object to Python code before setting all items to a real object with PyList_SetItem() or PyList_SET_ITEM().... The following APIs are safe APIs before the list is fully initialized: PyList_SetItem() and PyList_SET_ITEM() . Py_ssize_t PyList_Size ( PyObject * list ) ¶ 次に属します: Stable ABI . Thread safety: Atomic ....another thread modifies the list concurrently. Prefer PyList_GetItemRef() , which returns a strong reference . int PyList_SetItem ( PyObject * list , Py_ssize_t index , PyObject * item ) ¶ 次に属します: Stable ABI . Thread safety: Atomic . リストオブジ... - https://man.mtool.work/python/3.14/c-api/list.html
- タプルオブジェクト (tuple object) — Python 3.14.8 ドキュメント 10775
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » タプルオブジェクト (tuple object) テーマ 自動 ライト ダーク | タプルオブジェクト (tup
...is the equivalent of the Python expression p[low:high] . Indexing from the end of the tuple is not supported. int PyTuple_SetItem ( PyObject * p , Py_ssize_t pos , PyObject * o ) ¶ 次に属します: Stable ABI . Insert a reference to object o at position p...ected position (unless it was NULL). void PyTuple_SET_ITEM ( PyObject * p , Py_ssize_t pos , PyObject * o ) ¶ Like PyTuple_SetItem() , but does no error checking, and should only be used to fill in brand new tuples. Bounds checking is performed as an as...if Python is built in debug mode or with assertions . 注釈 This function " steals " a reference to o , and, unlike PyTuple_SetItem() , does not discard a reference to any item that is being replaced; any reference in the tuple at position pos will be le... - https://man.mtool.work/python/3.14/c-api/tuple.html
- はじめに — Python 3.14.8 ドキュメント 10462
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » はじめに テーマ 自動 ライト ダーク | はじめに ¶ Python のアプリケーションプログラマ用インタフェース (Application Programmer's Int
...ust not use that reference after the call. 参照を盗み取る関数はほとんどありません; 例外としてよく知られているのは、 PyList_SetItem() と PyTuple_SetItem() で、これらはシーケンスに入れる要素に対する参照を盗み取ります (しかし、要素の入る先のタプルやリストの...(とりあえず例外処理のことは忘れておきます; もっとよい書き方を後で示します): PyObject * t ; t = PyTuple_New ( 3 ); PyTuple_SetItem ( t , 0 , PyLong_FromLong ( 1L )); PyTuple_SetItem ( t , 1 , PyLong_FromLong ( 2L )); PyTuple_SetItem ( t , 2 , PyUnicode_...FromString ( "three" )); ここで、 PyLong_FromLong() は新しい参照を返し、すぐに PyTuple_SetItem() に盗まれます。参照が盗まれた後もそのオブジェクトを利用したい場合は、参照盗む関数を呼び出す前に、 Py_INCREF() を利用しても... - https://man.mtool.work/python/3.14/c-api/intro.html
- はじめに — Python 3.14.8 ドキュメント 10462
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » はじめに テーマ 自動 ライト ダーク | はじめに ¶ Python のアプリケーションプログラマ用インタフェース (Application Programmer's Int
...ust not use that reference after the call. 参照を盗み取る関数はほとんどありません; 例外としてよく知られているのは、 PyList_SetItem() と PyTuple_SetItem() で、これらはシーケンスに入れる要素に対する参照を盗み取ります (しかし、要素の入る先のタプルやリストの...(とりあえず例外処理のことは忘れておきます; もっとよい書き方を後で示します): PyObject * t ; t = PyTuple_New ( 3 ); PyTuple_SetItem ( t , 0 , PyLong_FromLong ( 1L )); PyTuple_SetItem ( t , 1 , PyLong_FromLong ( 2L )); PyTuple_SetItem ( t , 2 , PyUnicode_...FromString ( "three" )); ここで、 PyLong_FromLong() は新しい参照を返し、すぐに PyTuple_SetItem() に盗まれます。参照が盗まれた後もそのオブジェクトを利用したい場合は、参照盗む関数を呼び出す前に、 Py_INCREF() を利用しても... - https://man.mtool.work/python/3.14/c-api/intro.html
- タプルオブジェクト (tuple object) — Python 3.14.8 ドキュメント 9985
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » タプルオブジェクト (tuple object) テーマ 自動 ライト ダーク | タプルオブジェクト (tup
...is the equivalent of the Python expression p[low:high] . Indexing from the end of the tuple is not supported. int PyTuple_SetItem ( PyObject * p , Py_ssize_t pos , PyObject * o ) ¶ 次に属します: Stable ABI . Insert a reference to object o at position p...ected position (unless it was NULL). void PyTuple_SET_ITEM ( PyObject * p , Py_ssize_t pos , PyObject * o ) ¶ Like PyTuple_SetItem() , but does no error checking, and should only be used to fill in brand new tuples. Bounds checking is performed as an as...if Python is built in debug mode or with assertions . 注釈 This function " steals " a reference to o , and, unlike PyTuple_SetItem() , does not discard a reference to any item that is being replaced; any reference in the tuple at position pos will be le... - https://man.mtool.work/python/3.14/c-api/tuple.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 8895
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...fect to delegate dictionary access to a real underlying dictionary that is under our control. When the __getitem__() and __setitem__() methods of our MagicMock are called (normal dictionary access) then side_effect is called with the key (and in the cas...e of __setitem__ the value too). We can also control what is returned. After the MagicMock has been used we can use attributes like call_...was used: >>> my_dict = { 'a' : 1 , 'b' : 2 , 'c' : 3 } >>> def getitem ( name ): ... return my_dict [ name ] ... >>> def setitem ( name , val ): ... my_dict [ name ] = val ... >>> mock = MagicMock () >>> mock . __getitem__ . side_effect = getitem >>>... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 8895
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...fect to delegate dictionary access to a real underlying dictionary that is under our control. When the __getitem__() and __setitem__() methods of our MagicMock are called (normal dictionary access) then side_effect is called with the key (and in the cas...e of __setitem__ the value too). We can also control what is returned. After the MagicMock has been used we can use attributes like call_...was used: >>> my_dict = { 'a' : 1 , 'b' : 2 , 'c' : 3 } >>> def getitem ( name ): ... return my_dict [ name ] ... >>> def setitem ( name , val ): ... my_dict [ name ] = val ... >>> mock = MagicMock () >>> mock . __getitem__ . side_effect = getitem >>>... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- C API Stability — Python 3.14.8 ドキュメント 8582
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » C API Stability テーマ 自動 ライト ダーク | C API Stability ¶ Unless documented otherwise, Python's C API is covered by the Backw
...ct_GetItemWithError() PyDict_Items() PyDict_Keys() PyDict_Merge() PyDict_MergeFromSeq2() PyDict_New() PyDict_Next() PyDict_SetItem() PyDict_SetItemString() PyDict_Size() PyDict_Type PyDict_Update() PyDict_Values() PyEllipsis_Type PyEnum_Type PyErr_BadAr...List_AsTuple() PyList_GetItem() PyList_GetItemRef() PyList_GetSlice() PyList_Insert() PyList_New() PyList_Reverse() PyList_SetItem() PyList_SetSlice() PyList_Size() PyList_Sort() PyList_Type PyLongObject PyLongRangeIter_Type PyLong_AsDouble() PyLong_AsI...apping_HasKeyStringWithError() PyMapping_HasKeyWithError() PyMapping_Items() PyMapping_Keys() PyMapping_Length() PyMapping_SetItemString() PyMapping_Size() PyMapping_Values() PyMem_Calloc() PyMem_Free() PyMem_Malloc() PyMem_RawCalloc() PyMem_RawFree() P... - https://man.mtool.work/python/3.14/c-api/stable.html
- C API Stability — Python 3.14.8 ドキュメント 8582
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » C API Stability テーマ 自動 ライト ダーク | C API Stability ¶ Unless documented otherwise, Python's C API is covered by the Backw
...ct_GetItemWithError() PyDict_Items() PyDict_Keys() PyDict_Merge() PyDict_MergeFromSeq2() PyDict_New() PyDict_Next() PyDict_SetItem() PyDict_SetItemString() PyDict_Size() PyDict_Type PyDict_Update() PyDict_Values() PyEllipsis_Type PyEnum_Type PyErr_BadAr...List_AsTuple() PyList_GetItem() PyList_GetItemRef() PyList_GetSlice() PyList_Insert() PyList_New() PyList_Reverse() PyList_SetItem() PyList_SetSlice() PyList_Size() PyList_Sort() PyList_Type PyLongObject PyLongRangeIter_Type PyLong_AsDouble() PyLong_AsI...apping_HasKeyStringWithError() PyMapping_HasKeyWithError() PyMapping_Items() PyMapping_Keys() PyMapping_Length() PyMapping_SetItemString() PyMapping_Size() PyMapping_Values() PyMem_Calloc() PyMem_Free() PyMem_Malloc() PyMem_RawCalloc() PyMem_RawFree() P... - https://man.mtool.work/python/3.14/c-api/stable.html