Results of 1 - 10 of about 19 for bound (0.007 sec.)
- typing --- 型ヒントのサポート 12669
- typing --- 型ヒントのサポート Added in version 3.5. ソースコード: Lib/typing.py 注釈 Python ランタイムは、関数や変数の型アノテーションを強制しません。型アノテーションは、 type checkers や IDE、linterなどのサードパーティーツールで使われます。
...B : Sequence [ bytes ], S : ( int , str )]: ... OldT = TypeVar ( 'OldT' , contravariant = True ) OldB = TypeVar ( 'OldB' , bound = Sequence [ bytes ], covariant = True ) OldS = TypeVar ( 'OldS' , int , str ) class OldWeirdTrio ( Generic [ OldT , OldB...のアノテーションは、以下の書き方と同じ意味をより簡潔に表したものです。 from typing import TypeVar Self = TypeVar ( "Self" , bound = "Foo" ) class Foo : def return_self ( self : Self ) -> Self : ... return self 一般に、上の例のように self を返す場合は、...eric [ KT , VT ]): def __getitem__ ( self , key : KT ) -> VT : ... # など。 class typing. TypeVar ( name , * constraints , bound = None , covariant = False , contravariant = False , infer_variance = False , default = typing.NoDefault ) 型変数です。 型... - https://man.mtool.work/python/3.14/library/typing.html
- asyncio とフリースレッド Python 11320
- asyncio とフリースレッド Python asyncio uses an event loop as a scheduler to enable highly efficient concurrency by switching between tasks to allow non-blocking I/O operations. This results in better performance for I/O-bound use cases. It
...also allows off-loading CPU-bound work to a thread or process pool, but that is still limited by the global interpreter lock in CPython. 一方、 フリースレッ... - https://man.mtool.work/python/3.14/library/asyncio-threading.html
- secrets --- 機密を扱うために安全な乱数を生成する 11320
- secrets --- 機密を扱うために安全な乱数を生成する Added in version 3.6. ソースコード: Lib/secrets.py secrets モジュールは、パスワード、アカウント認証、セキュリティトークン、その他の機密情報の管理に適した、暗号学的に強い乱数を生成するために使
...さい。 secrets. choice ( seq ) 空でないシーケンスから要素をランダムに選択して返します。 secrets. randbelow ( exclusive_upper_bound ) [0, exclusive_upper_bound ) の範囲のランダムな整数を返します。 secrets. randbits ( k ) ランダムな k ビットの非負の整数を... - https://man.mtool.work/python/3.14/library/secrets.html
- ast --- 抽象構文木 9971
- ast --- 抽象構文木 ソースコード: Lib/ast.py ast モジュールは、Python の抽象構文を表す木を Python アプリケーションで処理するための機能を提供します。 抽象構文自体は Python のリリースごとに変わる可能性がありますが、このモジュールを使えば、現在
...int end_col_offset ) type_ignore = TypeIgnore ( int lineno , string tag ) type_param = TypeVar ( identifier name , expr ? bound , expr ? default_value ) | ParamSpec ( identifier name , expr ? default_value ) | TypeVarTuple ( identifier name , expr ?...名 ( _fields にも列挙されています) をその型に対応付ける辞書です。 >>> ast . TypeVar . _field_types {'name': <class 'str'>, 'bound': ast.expr | None, 'default_value': ast.expr | None} Added in version 3.13. lineno col_offset end_lineno end_col_offset as...in version 3.8. 型パラメーター クラス、関数、型エイリアスには 型パラメーター を定義できます。 class ast. TypeVar ( name , bound , default_value ) typing.TypeVar を表します。 name は型変数の名前です。 bound は、指定されていれば上限または制約を保持しま... - https://man.mtool.work/python/3.14/library/ast.html
- 8. 複合文 (compound statement) 9971
- 8. 複合文 (compound statement) 複合文には、他の文 (のグループ) が入ります; 複合文は、中に入っている他の文の実行の制御に何らかのやり方で影響を及ぼします。一般的には、複合文は複数行にまたがって書かれますが、全部の文を一行に連ねた単純な書き方も
...型パラメータリストの構文で宣言した typing.TypeVar では、ジェネリックなオブジェクトの作成時には上限と制約を評価しません。 __bound__ 属性や __constraints__ 属性を通じて明示的に値にアクセスしたときに初めて評価します。 これを実現するため、上限や制約は独立...ります。 次の例は、指定できる型パラメータ宣言のすべての種類を示しています。 def overly_generic [ SimpleTypeVar , TypeVarWithBound : int , TypeVarWithConstraints : ( str , bytes ), TypeVarWithDefault = int , * SimpleTypeVarTuple = ( int , float ), ** Si...mpleParamSpec = ( str , bytearray ), ]( a : SimpleTypeVar , b : TypeVarWithDefault , c : TypeVarWithBound , d : Callable [ SimpleParamSpec , TypeVarWithConstraints ], * e : SimpleTypeVarTuple , ): ... 8.10.1. ジェネリック関数 ジ... - https://man.mtool.work/python/3.14/reference/compound_stmts.html
- 10. 完全な文法仕様 9066
- 10. 完全な文法仕様 以下は Python の完全な文法で、CPython のパーサを生成するための文法から直接得たものです ( Grammar/python.gram を参照)。 ここでは、コード生成とエラー回復に関する詳細を省略しています。 ここで使う記法は、これまでのドキュメント
...------ type_params : | '[' type_param_seq ']' type_param_seq : ',' . type_param + [ ',' ] type_param : | NAME [ type_param_bound ] [ type_param_default ] | '*' NAME [ type_param_starred_default ] | '**' NAME [ type_param_default ] type_param_bound : '... - https://man.mtool.work/python/3.14/reference/grammar.html
- 4. 実行モデル 8623
- 4. 実行モデル 4.1. プログラムの構造 Python プログラムはコードブロックから構成されます。 ブロック ( block ) は、一つのまとまりとして実行される Python プログラムテキストの断片です。 モジュール、関数本体、そしてクラス定義はブロックであり、対話
...rror 例外が送出されます。 現在のスコープが関数のもので、名前が使われる場所でローカル変数がまだ値に束縛されていない場合、 UnboundLocalError 例外が送出されます。 UnboundLocalError は NameError の子クラスです。 コードブロック内のどこかに名前の束縛操作があ...名前を束縛できます。 ブロックのテキスト全体から名前の束縛操作を探すことで、そのブロックのローカル変数を判断できます。 例は UnboundLocalError についての FAQ 項目 を参照してください。 If the global statement occurs within a block, all uses of the names sp...... ZeroDivisionError : division by zero >>> def func [ T : 1 / 0 ](): pass >>> T = func . __type_params__ [ 0 ] >>> T . __bound__ Traceback (most recent call last): ... ZeroDivisionError : division by zero この例では、型エイリアスの __value__ 属性また... - https://man.mtool.work/python/3.14/reference/executionmodel.html
- イベントループ 8179
- イベントループ ソースコード: Lib/asyncio/events.py , Lib/asyncio/base_events.py まえがき イベントループは全ての asyncio アプリケーションの中核をなす存在です。イベントループは非同期タスクやコールバックを実行し、ネットワーク I/O を処理し、サブ
...# 可能性があるので、スレッドプールで実行する。 with open ( '/dev/urandom' , 'rb' ) as f : return f . read ( 100 ) def cpu_bound (): # CPU バウンドな処理はイベントループをブロックする。 # 通常はプロセスプールで実行する方がよい。 return sum ( i * i for...で実行する: with concurrent . futures . ProcessPoolExecutor () as pool : result = await loop . run_in_executor ( pool , cpu_bound ) print ( 'custom process pool' , result ) # 4. 自分で作成したインタープリタプールで実行する: with concurrent . futures ....InterpreterPoolExecutor () as pool : result = await loop . run_in_executor ( pool , cpu_bound ) print ( 'custom interpreter pool' , result ) if __name__ == '__main__' : asyncio . run ( main ()) 例の 3 番では、 Proces... - https://man.mtool.work/python/3.14/library/asyncio-eventloop.html
- http.cookies --- HTTP の状態管理 8179
- http.cookies --- HTTP の状態管理 ソースコード: Lib/http/cookies.py http.cookies モジュールは、HTTP の状態管理機構であるクッキーの概念を抽象化したクラスを定義しています。 単純な文字列だけのクッキーをサポートするほか、シリアライズ可能な任意の
...しなければなりません。 In addition, it is recommended to use the __Host prefix when setting partitioned cookies to make them bound to the hostname and not the registrable domain. Read CHIPS (Cookies Having Independent Partitioned State) for full details... - https://man.mtool.work/python/3.14/library/http.cookies.html
- symtable --- コンパイラーの記号表へのアクセス 8179
- symtable --- コンパイラーの記号表へのアクセス ソースコード: Lib/symtable.py 記号表は、バイトコードを生成する直前にコンパイラーが AST から生成します。 コード内のすべての識別子のスコープを決める役割を担います。 symtable はこれらの記号表を調べ
...類を返します。 戻り値は SymbolTableType 列挙型のメンバーです。 バージョン 3.12 で変更: 戻り値として 'annotation' 、 'TypeVar bound' 、 'type alias' 、 'type parameter' が追加されました。 バージョン 3.13 で変更: 戻り値が SymbolTableType 列挙型のメンバーに...erences PHP language.variables.superglobals PHP get_called_class() PHP var.setup PHP book.classobj PHP enum.random-intervalboundary... - https://man.mtool.work/python/3.14/library/symtable.html