per page, with , order by , clip by
Results of 1 - 8 of about 8 for GenericAlias (0.009 sec.)
型ヒントのためのオブジェクト 13718
型ヒントのためのオブジェクト 型ヒント用の組み込み型を提供しています。 現在は GenericAlias と Union の二つがあり、このうち C に公開されているのは GenericAlias だけです。 PyObject * Py_GenericAlias ( PyObject * origin , PyObject * args ) 次に ... 属します: Stable ABI (バージョン 3.9 より). GenericAlias オブジェクトを生成します。Pythonクラス types.GenericAlias を呼び出すことと同等です。引数 origin と args は GenericAlias の ... rgs,) が設定されます。引数チェックは最小限なため、たとえ origin が型を示すオブジェクトでなくても関数呼び出しは成功します。 GenericAlias の __parameters__ 属性は __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
types --- 動的な型生成と組み込み型の名前 9254
types --- 動的な型生成と組み込み型の名前 ソースコード: Lib/types.py このモジュールは新しい型の動的な生成を支援するユーティリティ関数を定義します。 さらに、標準の Python インタプリタによって使用されているものの、 int や str のように組み込みと ... oduleType のインスタンスを作成できます。 class types. EllipsisType Ellipsis の型です。 Added in version 3.10. class types. GenericAlias ( t_origin , t_args ) list[int] など、 パラメータ化されたジェネリック の型です。 t_origin は list 、 tuple 、 dict などのパ ... ある必要があります。 t_args は t_origin をパラメータ化する型の tuple です (長さが 1 でも構いません)。 >>> from types import GenericAlias >>> list [ int ] == GenericAlias ( list , ( int ,)) True >>> dict [ str , int ] == GenericAlias ( dict , ( str , int )) Tr ... version 3.9. バージョン 3.9.2 で変更: この型のサブクラスを作成できるようになりました。 参考 ジェネリックエイリアス型 types.GenericAlias のインスタンスについて詳しく説明したドキュメント PEP 585 - 標準コレクション型の型ヒントにおける総称型 (generics) の使用 ty ...
https://man.mtool.work/python/3.14/library/types.html
3. データモデル 8314
3. データモデル 3.1. オブジェクト、値、および型 オブジェクト は、Python がデータを抽象化したものです。 Python プログラム内のすべてのデータは、オブジェクトまたはオブジェクト間の関係として表されます。 コードもオブジェクトで表されます。 すべて ... 場合は、代わりにクラスメソッド __class_getitem__() が呼び出されることがあります。 __class_getitem__() を適切に定義するには、 GenericAlias オブジェクトを返すようにします。 式 obj[x] を処理するとき、Python インタープリタはおおむね次の手順で __getitem__() と __cl ... e >>> # "list[int]" は "list.__class_getitem__(int)" を呼び出す >>> list [ int ] list[int] >>> # list.__class_getitem__ は GenericAlias オブジェクトを返す: >>> type ( list [ int ]) <class 'types.GenericAlias'> ただし、クラスのメタクラスが独自に __getitem__() ... num.EnumMeta'> >>> # EnumMeta defines __getitem__, >>> # so __class_getitem__ is not called, >>> # and the result is not a GenericAlias object: >>> Menu [ 'SPAM' ] <Menu.SPAM: 'spam'> >>> type ( Menu [ 'SPAM' ]) <enum 'Menu'> 参考 PEP 560 - typing モジュール ...
https://man.mtool.work/python/3.14/reference/datamodel.html
C API Stability 8260
C API Stability 特記のない限り、Python の C API には後方互換性ポリシー PEP 387 が適用されます。 変更の大半はソース互換性を保ちます (通常は新しい API の追加だけを行います)。 既存 API の変更や削除は、非推奨の期間を経た後、または重大な問題を修 ... ) Py_Exit() Py_FatalError() Py_FileSystemDefaultEncodeErrors Py_FileSystemDefaultEncoding Py_Finalize() Py_FinalizeEx() Py_GenericAlias() Py_GenericAliasType Py_GetBuildInfo() Py_GetCompiler() Py_GetConstant() Py_GetConstantBorrowed() Py_GetCopyright() Py_Ge ...
https://man.mtool.work/python/3.14/c-api/stable.html
変更履歴 8260
変更履歴 次の Python バージョン リリース日: XXXX-XX-XX セキュリティ gh-160499 : Fix unbounded memory growth in asyncio TLS connections when a peer stops reading but keeps sending records that make OpenSSL generate its own replies (such as T ... eak reference proxies when another operand is a dead proxy. gh-159739 : Fix a crash when constructing an error for invalid generic alias arguments. gh-159739 : Allow the garbage collector to break reference cycles involving property accessors or names. gh-15 ... ない文字 (単独のサロゲートなど) を名前に含むモジュールをインポートするとクラッシュする問題を修正しました。 gh-155752 : types.GenericAlias の引数に、エイリアスのパラメーターがキャッシュされた後で __typing_subst__ フックが追加されるとクラッシュする問題を修正しま ... クトを解放する際に、インタープリターがクラッシュする問題を修正しました。 Sergey Miryanov による貢献です。 gh-154275 : types.GenericAlias オブジェクトから深く入れ子になった __parameters__ を取得するとクラッシュする問題を修正しました。 gh-153932 : enumerate の ...
https://man.mtool.work/python/3.14/whatsnew/changelog.html
Python ドキュメントの目次 8133
Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列 ... キストマネージャ型 型アノテーション型 --- ジェネリックエイリアス 、 ユニオン ジェネリックエイリアス型 標準ジェネリッククラス GenericAlias オブジェクトの特別な属性 Union 型 その他の組み込み型 モジュール クラスおよびクラスインスタンス 関数 メソッド コードオブジェ ...
https://man.mtool.work/python/3.14/contents.html
What's New In Python 3.10 8133
What's New In Python 3.10 編集者 : Pablo Galindo Salgado この記事では Python 3.9 と比較した Python 3.10 の新機能を解説します。Python 3.10 は2021年10月4日にリリースされました。全詳細については 変更履歴 をご覧ください。 概要 -- リリースハイラ ... able[[int, str], str] の __args__ は (int, str, str) になります。 以前は ([int, str], str) でした。 この変更のため、 types.GenericAlias をサブクラス化できるようにし、 collections.abc.Callable 型に添字を指定するとサブクラスを返すようにしました。 Python 3.9 で ...
https://man.mtool.work/python/3.14/whatsnew/3.10.html
What's New In Python 3.9 8133
What's New In Python 3.9 編集者 : Łukasz Langa この記事では Python 3.8 と比較した Python 3.9 の新機能を解説します。 Python 3.9 は 2020 年 10 月 5 日にリリースされました。 詳しくは 変更履歴 を参照してください。 参考 PEP 596 - Python 3.9 リリ ... str], str] の __args__ は、以前の ([int, str], str) ではなく (int, str, str) になります。 この変更を可能にするため、 types.GenericAlias をサブクラス化できるようになり、 collections.abc.Callable 型に添字を付けるとサブクラスを返します。 typing.get_args() または ...
https://man.mtool.work/python/3.14/whatsnew/3.9.html
PREV 1 NEXT