Results of 1 - 10 of about 52 for issubclass (0.032 sec.)
- collections.abc --- コンテナの抽象基底クラス — Python 3.14.8 ドキュメント 14024
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » collections.abc --- コンテナの抽象基底クラス テーマ 自動 ライト ダーク | collections.abc --- コンテナの抽象基底クラス ¶
...底クラスは、クラスが特定のインターフェースを提供しているか、例えば ハッシュ可能 であるかや マッピング であるかを判定します。 issubclass() や isinstance() を使ったインターフェースに対するテストは、以下の3つのいずれかの方法で動作します。 A newly written class...__len__ ( self ): ... # Required abstract method def count ( self , value ): ... # Optionally override a mixin method >>> issubclass ( C , Sequence ) True >>> isinstance ( C (), Sequence ) True Existing classes and built-in classes can be registered as "v...ses should define the full API including all of the abstract methods and all of the mixin methods. This lets users rely on issubclass() or isinstance() tests to determine whether the full interface is supported. The exception to this rule is for methods th... - https://man.mtool.work/python/3.14/library/collections.abc.html
- collections.abc --- コンテナの抽象基底クラス — Python 3.14.8 ドキュメント 12605
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » collections.abc --- コンテナの抽象基底クラス テーマ 自動 ライト ダーク | collections.abc --- コンテナの抽象基底クラス ¶
...底クラスは、クラスが特定のインターフェースを提供しているか、例えば ハッシュ可能 であるかや マッピング であるかを判定します。 issubclass() や isinstance() を使ったインターフェースに対するテストは、以下の3つのいずれかの方法で動作します。 A newly written class...__len__ ( self ): ... # Required abstract method def count ( self , value ): ... # Optionally override a mixin method >>> issubclass ( C , Sequence ) True >>> isinstance ( C (), Sequence ) True Existing classes and built-in classes can be registered as "v...ses should define the full API including all of the abstract methods and all of the mixin methods. This lets users rely on issubclass() or isinstance() tests to determine whether the full interface is supported. The exception to this rule is for methods th... - https://man.mtool.work/python/3.14/library/collections.abc.html
- abc --- 抽象基底クラス — Python 3.14.8 ドキュメント 10813
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » abc --- 抽象基底クラス テーマ 自動 ライト ダーク | abc --- 抽象基底クラス ¶ ソースコード: Lib/abc.py こ
...象クラス(組み込み型でも構いません)と無関係な ABC を "仮想的サブクラス" として登録できます -- これらとその子孫は組み込み関数 issubclass() によって登録した ABC のサブクラスと判定されますが、登録した ABC は MRO (Method Resolution Order, メソッド解決順)には現れ...ラス" としてこの ABC に登録します。たとえば: from abc import ABC class MyABC ( ABC ): pass MyABC . register ( tuple ) assert issubclass ( tuple , MyABC ) assert isinstance ((), MyABC ) バージョン 3.3 で変更: クラスデコレータとして使うことができるように、登録...なりません。) Check whether subclass is considered a subclass of this ABC. This means that you can customize the behavior of issubclass() further without the need to call register() on every class you want to consider a subclass of the ABC. (This class metho... - https://man.mtool.work/python/3.14/library/abc.html
- abc --- 抽象基底クラス — Python 3.14.8 ドキュメント 10813
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » abc --- 抽象基底クラス テーマ 自動 ライト ダーク | abc --- 抽象基底クラス ¶ ソースコード: Lib/abc.py こ
...象クラス(組み込み型でも構いません)と無関係な ABC を "仮想的サブクラス" として登録できます -- これらとその子孫は組み込み関数 issubclass() によって登録した ABC のサブクラスと判定されますが、登録した ABC は MRO (Method Resolution Order, メソッド解決順)には現れ...ラス" としてこの ABC に登録します。たとえば: from abc import ABC class MyABC ( ABC ): pass MyABC . register ( tuple ) assert issubclass ( tuple , MyABC ) assert isinstance ((), MyABC ) バージョン 3.3 で変更: クラスデコレータとして使うことができるように、登録...なりません。) Check whether subclass is considered a subclass of this ABC. This means that you can customize the behavior of issubclass() further without the need to call register() on every class you want to consider a subclass of the ABC. (This class metho... - https://man.mtool.work/python/3.14/library/abc.html
- 型オブジェクト — Python 3.14.8 ドキュメント 8319
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » 型オブジェクト テーマ 自動 ライト ダーク | 型オブジェクト ¶ type PyTypeObject ¶ 次に属
...す。 This function only checks for actual subtypes, which means that __subclasscheck__() is not called on b . Call PyObject_IsSubclass() to do the same check that issubclass() would do. PyObject * PyType_GenericAlloc ( PyTypeObject * type , Py_ssize_t nitem... - https://man.mtool.work/python/3.14/c-api/type.html
- 9. クラス — Python 3.14.8 ドキュメント 8319
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python チュートリアル » 9. クラス テーマ 自動 ライト ダーク | 9. クラス ¶ クラスはデータと機能を組み合わせる方法を提供します。 新規にクラスを作成することで、新し
...スタンスの型が調べられます。 isinstance(obj, int) は obj.__class__ が int や int の派生クラスの場合に限り True になります。 issubclass() を使うとクラスの継承関係が調べられます。 bool は int のサブクラスなので issubclass(bool, int) は True です。しかし、 flo...at は int のサブクラスではないので issubclass(float, int) は False です。 9.5.1. 多重継承 ¶ Python では、多重継承 (multiple inheritance) の形式もサポートしています。複数... - https://man.mtool.work/python/3.14/tutorial/classes.html
- 変更履歴 — Python 3.14.8 ドキュメント 8319
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » 変更履歴 テーマ 自動 ライト ダーク | 変更履歴 ¶ Python next ¶ Release date: XXXX-XX-XX セキュリティ ¶ gh-157265 : In tarfile , when extrac
....RobotFileParser.read() . gh-71339 : Add new assertion methods for unittest : assertHasAttr() , assertNotHasAttr() , assertIsSubclass() , assertNotIsSubclass() assertStartsWith() , assertNotStartsWith() , assertEndsWith() and assertNotEndsWith() . gh-11876...ases created using typing.Annotated ). Previously only AttributeError was ignored. Patch by Dave Shawley. gh-112903 : Fix "issubclass() arg 1 must be a class" errors in certain cases of multiple inheritance with generic aliases (regression in early 3.13 al...cross-platform build environments. gh-112727 : Speed up pathlib.Path.absolute() . Patch by Barney Gale. gh-74690 : Speedup issubclass() checks against simple runtime-checkable protocols by around 6%. Patch by Alex Waygood. gh-74690 : Speedup isinstance() c... - https://man.mtool.work/python/3.14/whatsnew/changelog.html
- 型オブジェクト — Python 3.14.8 ドキュメント 8319
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 具象オブジェクト (concrete object) レイヤ » 型オブジェクト テーマ 自動 ライト ダーク | 型オブジェクト ¶ type PyTypeObject ¶ 次に属
...す。 This function only checks for actual subtypes, which means that __subclasscheck__() is not called on b . Call PyObject_IsSubclass() to do the same check that issubclass() would do. PyObject * PyType_GenericAlloc ( PyTypeObject * type , Py_ssize_t nitem... - https://man.mtool.work/python/3.14/c-api/type.html
- 9. クラス — Python 3.14.8 ドキュメント 8319
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python チュートリアル » 9. クラス テーマ 自動 ライト ダーク | 9. クラス ¶ クラスはデータと機能を組み合わせる方法を提供します。 新規にクラスを作成することで、新し
...スタンスの型が調べられます。 isinstance(obj, int) は obj.__class__ が int や int の派生クラスの場合に限り True になります。 issubclass() を使うとクラスの継承関係が調べられます。 bool は int のサブクラスなので issubclass(bool, int) は True です。しかし、 flo...at は int のサブクラスではないので issubclass(float, int) は False です。 9.5.1. 多重継承 ¶ Python では、多重継承 (multiple inheritance) の形式もサポートしています。複数... - https://man.mtool.work/python/3.14/tutorial/classes.html
- typing --- 型ヒントのサポート — Python 3.14.8 ドキュメント 7960
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » typing --- 型ヒントのサポート テーマ 自動 ライト ダーク | typing --- 型ヒントのサポート ¶ Added in version 3.5. ソース
...d not use Self as the return annotation if the method is not guaranteed to return an instance of a subclass when the class is subclassed: class Eggs : # Self would be an incorrect return annotation here, # as the object returned is always an instance of Eg...は型のみを受け入れ、それ以外は受け付けられません。 ClassVar is not a class itself, and cannot be used with isinstance() or issubclass() . ClassVar does not change Python runtime behavior, but it can be used by static type checkers. For example, a type chec...ng their type signatures. Protocol classes without this decorator cannot be used as the second argument to isinstance() or issubclass() . プロトコルクラスはジェネリックにもできます。例えば: class GenProto [ T ]( Protocol ): def meth ( self ) -> T : ... In... - https://man.mtool.work/python/3.14/library/typing.html