per page, with , order by , clip by
Results of 1 - 3 of about 3 for agen (0.004 sec.)
asyncio での開発 11812
asyncio での開発 非同期プログラミングは、従来の「逐次的」なプログラミングとは異なります。 このページはよくある間違いや落とし穴を列挙し、それらを回避する方法を説明します。 デバッグモード asyncio はデフォルトで本運用モードで実行されます。いっ ... will not be able to terminate the generator if necessary. 次に示す例について考えてみてください。: import asyncio async def agenfn (): try : yield 10 finally : await asyncio . sleep ( 0 ) with asyncio . Runner () as runner : agen = agenfn () print ( r ... unner . run ( anext ( agen ))) del agen 出力: 10 Exception ignored while closing generator < async_generator object agenfn at 0x000002F71CD10D70 > : ... Traceback ( most recent call last ): File "example.py" , line 13 , in < module > del agen ^^^^ RuntimeError : async generator ignored GeneratorExit この例は次のように修正できます。 import asyncio async def agenfn ...
https://man.mtool.work/python/3.14/library/asyncio-dev.html
inspect --- 活動中のオブジェクトを調査する 8687
inspect --- 活動中のオブジェクトを調査する ソースコード: Lib/inspect.py inspect モジュールは、モジュール、クラス、メソッド、関数、トレースバック、フレームオブジェクト、コードオブジェクトなど、実行中のオブジェクトの情報を取得する便利な関数を ... ( object ) オブジェクトが非同期ジェネレータ asynchronous generator 関数である場合に True を返します。使用例: >>> async def agen (): ... yield 1 ... >>> inspect . isasyncgenfunction ( agen ) True Added in version 3.6. バージョン 3.8 で変更: functools. ... PENDED: await 式により現在停止中です。 CORO_CLOSED: 実行が完了しました。 Added in version 3.5. inspect. getasyncgenstate ( agen ) Get current state of an asynchronous generator object. The function is intended to be used with asynchronous iterator ob ... ement, but will accept any asynchronous generator-like object that has ag_running and ag_frame attributes. 取り得る状態は: AGEN_CREATED: 実行の開始を待っています。 AGEN_RUNNING: インタープリタが現在実行しています。 AGEN_SUSPENDED: yield 式で現在中断し ...
https://man.mtool.work/python/3.14/library/inspect.html
6. 式 (expression) 7385
6. 式 (expression) この章では、Python の式における個々の要素の意味について解説します。 構文上の注意: この章以降では、 文法の表記法 を字句解析ではなく構文の記述に使います。 構文規則の (選択肢の 1 つの) 形式が次のように記述され、 name : other ... 関数は非同期ジェネレータ関数になります。 例えば次のようになります: def gen (): # ジェネレータ関数を定義 yield 123 async def agen (): # 非同期ジェネレータ関数を定義 yield 123 内包表記やジェネレータ式を実装するために暗黙的に定義されるスコープ内では、 yi ... タの実装能力の追加による PEP 492 の拡張提案。 6.2.10.1. Generator-iterator methods This subsection describes the methods of a generator iterator. They can be used to control the execution of a generator function. Note that calling any of the generator ... low when the generator is already executing raises a ValueError exception. generator. __next__ ( ) Starts the execution of a generator function or resumes it at the last executed yield expression. When a generator function is resumed with a __next__( ...
https://man.mtool.work/python/3.14/reference/expressions.html
PREV 1 NEXT