per page, with , order by , clip by
Results of 1 - 10 of about 58 for sentinel (0.011 sec.)
2. 拡張の型の定義: チュートリアル — Python 3.14.8 ドキュメント 11021
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python インタプリタの拡張と埋め込み » 2. 拡張の型の定義: チュートリアル テーマ 自動 ライト ダーク | 2. 拡張の型の定義: チュートリアル ¶ Python では、組み込みの s ... last ), 0 , "last name" }, { "number" , Py_T_INT , offsetof ( CustomObject , number ), 0 , "custom number" }, { NULL } /* Sentinel */ }; static PyObject * Custom_name ( PyObject * op , PyObject * Py_UNUSED ( dummy )) { CustomObject * self = ( CustomObje ... _methods [] = { { "name" , Custom_name , METH_NOARGS , "Return the name, combining the first and last name" }, { NULL } /* Sentinel */ }; static PyTypeObject CustomType = { . ob_base = PyVarObject_HEAD_INIT ( NULL , 0 ) . tp_name = "custom2.Custom" , . t ... last ), 0 , "last name" }, { "number" , Py_T_INT , offsetof ( CustomObject , number ), 0 , "custom number" }, { NULL } /* Sentinel */ }; そして、この定義を tp_members スロットに入れましょう: . tp_members = Custom_members , Each member definition has a m ...
https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 11021
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ ... スコープ内にあるモジュールやクラスの属性を変更する patch() デコレータを提供します。さらに、ユニークなオブジェクトの作成には sentinel が利用できます。 Mock や MagicMock 、 patch() の利用例は quick guide を参照してください。 Mock は unittest で利用するために ... 戻り値はモックオブジェクトです。通常の方法で設定することもできます: >>> mock = Mock () >>> mock . return_value . attribute = sentinel . Attribute >>> mock . return_value () <Mock name='mock()()' id='...'> >>> mock . return_value . assert_called_with () ret ... バージョンで動作するはずです。 [ 3 ] 関数はクラスまで hook しますが、各 Mock インスタンス間の独立性は保たれます。 ヘルパー ¶ sentinel ¶ unittest.mock. sentinelsentinel オブジェクトはテストで必要なユニークなオブジェクトを簡単に提供します。 属性はアクセス ...
https://man.mtool.work/python/3.14/library/unittest.mock.html
2. 拡張の型の定義: チュートリアル — Python 3.14.8 ドキュメント 11021
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python インタプリタの拡張と埋め込み » 2. 拡張の型の定義: チュートリアル テーマ 自動 ライト ダーク | 2. 拡張の型の定義: チュートリアル ¶ Python では、組み込みの s ... last ), 0 , "last name" }, { "number" , Py_T_INT , offsetof ( CustomObject , number ), 0 , "custom number" }, { NULL } /* Sentinel */ }; static PyObject * Custom_name ( PyObject * op , PyObject * Py_UNUSED ( dummy )) { CustomObject * self = ( CustomObje ... _methods [] = { { "name" , Custom_name , METH_NOARGS , "Return the name, combining the first and last name" }, { NULL } /* Sentinel */ }; static PyTypeObject CustomType = { . ob_base = PyVarObject_HEAD_INIT ( NULL , 0 ) . tp_name = "custom2.Custom" , . t ... last ), 0 , "last name" }, { "number" , Py_T_INT , offsetof ( CustomObject , number ), 0 , "custom number" }, { NULL } /* Sentinel */ }; そして、この定義を tp_members スロットに入れましょう: . tp_members = Custom_members , Each member definition has a m ...
https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 11021
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ ... スコープ内にあるモジュールやクラスの属性を変更する patch() デコレータを提供します。さらに、ユニークなオブジェクトの作成には sentinel が利用できます。 Mock や MagicMock 、 patch() の利用例は quick guide を参照してください。 Mock は unittest で利用するために ... 戻り値はモックオブジェクトです。通常の方法で設定することもできます: >>> mock = Mock () >>> mock . return_value . attribute = sentinel . Attribute >>> mock . return_value () <Mock name='mock()()' id='...'> >>> mock . return_value . assert_called_with () ret ... バージョンで動作するはずです。 [ 3 ] 関数はクラスまで hook しますが、各 Mock インスタンス間の独立性は保たれます。 ヘルパー ¶ sentinel ¶ unittest.mock. sentinelsentinel オブジェクトはテストで必要なユニークなオブジェクトを簡単に提供します。 属性はアクセス ...
https://man.mtool.work/python/3.14/library/unittest.mock.html
イテレータオブジェクト (iterator object) — Python 3.14.8 ドキュメント 10816
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » イテレータオブジェクト (iterator object) テーマ 自動 ライト ダーク | イテレータオブジ ... スイテレータで、 __getitem__() メソッドをサポートする任意のシーケンスを取り扱います。二つ目は呼び出し可能オブジェクトと番兵 (sentinel value) を扱い、シーケンス内の要素ごとに呼び出し可能オブジェクトを呼び出して、センチネル値が返されたときに反復処理を終了しま ... lIter_Type 型の場合に真を返します。この関数は常に成功します。 PyObject * PyCallIter_New ( PyObject * callable , PyObject * sentinel ) ¶ 戻り値: 新しい参照。 次に属します: Stable ABI . 新たなイテレータを返します。最初のパラメタ callable は引数なしで呼び出 ... callable は、呼び出されるたびに次の反復処理対象オブジェクトを返さなければなりません。生成されたイテレータは、 callable が sentinel に等しい値を返すと反復処理を終了します。 Range Objects ¶ PyTypeObject PyRange_Type ¶ 次に属します: Stable ABI . The type o ...
https://man.mtool.work/python/3.14/c-api/iterator.html
イテレータオブジェクト (iterator object) — Python 3.14.8 ドキュメント 10816
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » イテレータオブジェクト (iterator object) テーマ 自動 ライト ダーク | イテレータオブジ ... スイテレータで、 __getitem__() メソッドをサポートする任意のシーケンスを取り扱います。二つ目は呼び出し可能オブジェクトと番兵 (sentinel value) を扱い、シーケンス内の要素ごとに呼び出し可能オブジェクトを呼び出して、センチネル値が返されたときに反復処理を終了しま ... lIter_Type 型の場合に真を返します。この関数は常に成功します。 PyObject * PyCallIter_New ( PyObject * callable , PyObject * sentinel ) ¶ 戻り値: 新しい参照。 次に属します: Stable ABI . 新たなイテレータを返します。最初のパラメタ callable は引数なしで呼び出 ... callable は、呼び出されるたびに次の反復処理対象オブジェクトを返さなければなりません。生成されたイテレータは、 callable が sentinel に等しい値を返すと反復処理を終了します。 Range Objects ¶ PyTypeObject PyRange_Type ¶ 次に属します: Stable ABI . The type o ...
https://man.mtool.work/python/3.14/c-api/iterator.html
unittest.mock --- 入門 — Python 3.14.8 ドキュメント 10231
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p ... ジェクトを受け取ります。 patch.object : >>> original = SomeClass . attribute >>> @patch . object ( SomeClass , 'attribute' , sentinel . attribute ) ... def test (): ... assert SomeClass . attribute == sentinel . attribute ... >>> test () >>> assert SomeCla ... ss . attribute == original >>> @patch ( 'package.module.attribute' , sentinel . attribute ) ... def test (): ... from package.module import attribute ... assert attribute is sentinel . attribute ... > ... 含む) をパッチしようとする場合、 patch.object() の代わりに patch() を使用してください: >>> mock = MagicMock ( return_value = sentinel . file_handle ) >>> with patch ( 'builtins.open' , mock ): ... handle = open ( 'filename' , 'r' ) ... >>> mock . assert_ca ...
https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
unittest.mock --- 入門 — Python 3.14.8 ドキュメント 10231
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p ... ジェクトを受け取ります。 patch.object : >>> original = SomeClass . attribute >>> @patch . object ( SomeClass , 'attribute' , sentinel . attribute ) ... def test (): ... assert SomeClass . attribute == sentinel . attribute ... >>> test () >>> assert SomeCla ... ss . attribute == original >>> @patch ( 'package.module.attribute' , sentinel . attribute ) ... def test (): ... from package.module import attribute ... assert attribute is sentinel . attribute ... > ... 含む) をパッチしようとする場合、 patch.object() の代わりに patch() を使用してください: >>> mock = MagicMock ( return_value = sentinel . file_handle ) >>> with patch ( 'builtins.open' , mock ): ... handle = open ( 'filename' , 'r' ) ... >>> mock . assert_ca ...
https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
dataclasses --- データクラス — Python 3.14.8 ドキュメント 8269
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » dataclasses --- データクラス テーマ 自動 ライト ダーク | dataclasses --- データクラス ¶ ソースコード: L ... ist [ int ] = field ( default_factory = list ) c = C () c . mylist += [ 1 , 2 , 3 ] As shown above, the MISSING value is a sentinel object used to detect if some parameters are provided by the user. This sentinel is used because None is a valid value for ... def is_dataclass_instance ( obj ): return is_dataclass ( obj ) and not isinstance ( obj , type ) dataclasses. MISSING ¶ A sentinel value signifying a missing default or default_factory. dataclasses. KW_ONLY ¶ A sentinel value used as a type annotation. ...
https://man.mtool.work/python/3.14/library/dataclasses.html
dataclasses --- データクラス — Python 3.14.8 ドキュメント 8269
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » dataclasses --- データクラス テーマ 自動 ライト ダーク | dataclasses --- データクラス ¶ ソースコード: L ... ist [ int ] = field ( default_factory = list ) c = C () c . mylist += [ 1 , 2 , 3 ] As shown above, the MISSING value is a sentinel object used to detect if some parameters are provided by the user. This sentinel is used because None is a valid value for ... def is_dataclass_instance ( obj ): return is_dataclass ( obj ) and not isinstance ( obj , type ) dataclasses. MISSING ¶ A sentinel value signifying a missing default or default_factory. dataclasses. KW_ONLY ¶ A sentinel value used as a type annotation. ...
https://man.mtool.work/python/3.14/library/dataclasses.html
PREV 1 2 3 4 5 6 NEXT