per page, with , order by , clip by
Results of 1 - 10 of about 23 for cached (0.007 sec.)
runpy --- Python モジュールの位置特定と実行 14260
runpy --- Python モジュールの位置特定と実行 ソースコード: Lib/runpy.py runpy モジュールは、Python モジュールをあらかじめインポートせずに見つけて実行するために使います。 主な用途はコマンドラインオプション -m の実装です。 このオプションを使う ... ている場合、その定義は run_module() によって上書きされます。 The special global variables __name__ , __spec__ , __file__ , __cached__ , __loader__ and __package__ are set in the globals dictionary before the module code is executed. (Note that this is a ... まり、 __spec__.name は常に mod_name または mod_name + '.__main__' であり、 run_name になることはありません)。 __file__ , __cached__ , __loader__ and __package__ are set as normal based on the module spec. 引数 alter_sys が与えられて True に評価されるな ... バージョン 3.1 で変更: __main__ サブモジュールを探してパッケージを実行する機能が追加されました。 バージョン 3.2 で変更: __cached__ グローバル変数が追加されました ( PEP 3147 を参照)。 バージョン 3.4 で変更: PEP 451 で追加されたモジュール仕様の機能を活用 ...
https://man.mtool.work/python/3.14/library/runpy.html
functools --- 高階関数と呼び出し可能オブジェクトの操作 11746
functools --- 高階関数と呼び出し可能オブジェクトの操作 ソースコード: Lib/functools.py functools モジュールは、ほかの関数を操作したり返したりする高階関数のためのモジュールです。 一般に、このモジュールではあらゆる呼び出し可能オブジェクトを関数 ... 理を薄いラッパーで包んだものです。 古い値を削除する必要がないため、サイズ制限付きの @lru_cache より小さく高速です。 例えば: @cache def factorial ( n ): return n * factorial ( n - 1 ) if n else 1 >>> factorial ( 10 ) # キャッシュ済みの結果がないため、11 回 ... 別のスレッドから呼び出された場合、ラップされた関数が複数回呼び出される可能性があります。 Added in version 3.9. @ functools. cached_property ( func ) クラスのメソッドをプロパティに変換します。 その値は一度だけ計算され、インスタンスが存続する間は通常の属性 ... プログラム例です: class DataSet : def __init__ ( self , sequence_of_numbers ): self . _data = tuple ( sequence_of_numbers ) @cached_property def stdev ( self ): return statistics . stdev ( self . _data ) @cached_property の仕組みは @property と少し異なり ...
https://man.mtool.work/python/3.14/library/functools.html
Python 3.15 で削除予定 10657
Python 3.15 で削除予定 インポートシステム: Setting __cached__ on a module while failing to set __spec__.cached is deprecated. In Python 3.15, __cached__ will cease to be set or take into consideration by the import system or standard librar ...
https://man.mtool.work/python/3.14/deprecations/pending-removal-in-3.15.html
モジュールのインポート 9249
モジュールのインポート PyObject * PyImport_ImportModule ( const char * name ) 戻り値: 新しい参照。 次に属します: Stable ABI . PyImport_Import() のラッパーで、引数として PyObject * の代わりに const char * を受け取ります。 PyObject * PyImport ... のインスタンスを設定します。 The module's __file__ attribute will be set to the code object's co_filename . If applicable, __cached__ will also be set. この関数は、すでにインポートされているモジュールの場合には再ロードを行います。意図的にモジュールの再ロ ... ExecCodeModuleEx() と PyImport_ExecCodeModuleWithPathnames() も参照してください。 バージョン 3.12 で変更: The setting of __cached__ and __loader__ is deprecated. See ModuleSpec for alternatives. PyObject * PyImport_ExecCodeModuleEx ( const char * name ... thname ) 戻り値: 新しい参照。 次に属します: Stable ABI (バージョン 3.7 より). Like PyImport_ExecCodeModuleEx() , but the __cached__ attribute of the module object is set to cpathname if it is non- NULL . Of the three functions, this is the preferred on ...
https://man.mtool.work/python/3.14/c-api/import.html
3. データモデル 9082
3. データモデル 3.1. オブジェクト、値、および型 オブジェクト は、Python がデータを抽象化したものです。 Python プログラム内のすべてのデータは、オブジェクトまたはオブジェクト間の関係として表されます。 コードもオブジェクトで表されます。 すべて ... e.__path__ の代わりに module.__spec__.submodule_search_locations を使うことを 強く 推奨します。 module. __file__ module. __cached__ __file__ and __cached__ are both optional attributes that may or may not be set. Both attributes should be a str when th ... leave it unset if it has no semantic meaning (for example, a module loaded from a database). If __file__ is set then the __cached__ attribute might also be set, which is the path to any compiled version of the code (for example, a byte-compiled file). ... exist to set this attribute; the path can simply point to where the compiled file would exist (see PEP 3147 ). Note that __cached__ may be set even if __file__ is not set. However, that scenario is quite atypical. Ultimately, the loader is what makes u ...
https://man.mtool.work/python/3.14/reference/datamodel.html
非推奨 8462
非推奨 Python 3.15 で削除予定 インポートシステム: Setting __cached__ on a module while failing to set __spec__.cached is deprecated. In Python 3.15, __cached__ will cease to be set or take into consideration by the import system or standard ...
https://man.mtool.work/python/3.14/deprecations/
デスクリプタ ガイド 8294
デスクリプタ ガイド Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を使うと、オブジェクトの属性の検索、保存、削除をカスタマイズできます。 本ガイドは4つの大項目から構成されています。 最初の「入門」では基本の紹介をし ... ています。 関数が束縛メソッドになるのも、この仕組みによるものです。 @classmethod 、 @staticmethod 、 @property 、 @functools.cached_property といったよく使う機能は、すべてデスクリプタとして実装されています。 実践的なサンプル このサンプルでは、発見が極めて ... bles is 35% faster with __slots__ (as measured with Python 3.10 on an Apple M1 processor). 5. Blocks tools like @functools.cached_property which require an instance dictionary to function correctly: from functools import cached_property class CP : __sl ... ots__ = () # インスタンス辞書をなくす @cached_property # インスタンス辞書が必要 def pi ( self ): return 4 * sum (( - 1.0 ) ** n / ( 2.0 * n + 1.0 ) for n in reversed ( ...
https://man.mtool.work/python/3.14/howto/descriptor.html
プログラミング FAQ 7993
プログラミング FAQ 一般的な質問 ブレークポイントやステップ実行ができる、ソースコードレベルのデバッガはありますか? はい。 Python 用のデバッガについては次に解説してあり、組み込みの breakpoint() 関数でそれらのデバッガに処理を移せます。 pdb モジ ... python-rocks' メソッド呼び出しをキャッシュするには どうしたらいいですか? メソッドのキャッシュに使う主なツールは @functools.cached_property と @functools.lru_cache です。 前者はインスタンス単位で、後者はクラス単位で結果を保存します。 cached_property は、 ... _temperature ( self ): "1 時間ごとの観測の最新値" # 古い結果は現在の状況を反映しないことがあるので、 # キャッシュしない。 @cached_property def location ( self ): "観測所の経度・緯度を返す" # 結果は station_id だけに依存する @lru_cache ( maxsize = 20 ) ... te、units に依存する。 上の例は station_id が変わらないことを前提としています。 関係するインスタンス属性が変更される場合、 cached_property は属性の変更を検出できないため、この方法は使えません。 To make the lru_cache approach work when the station_id is ...
https://man.mtool.work/python/3.14/faq/programming.html
What's New In Python 3.12 7993
What's New In Python 3.12 編集者 : Adam Turner この記事では Python 3.11 と比較した Python 3.12 の新機能を解説します。Python 3.12 は2023年10月2日にリリースされました。全詳細については 変更履歴 をご覧ください。 参考 PEP 693 -- Python 3.12 リリ ... の代わりに DeprecationWarning が出るようになりました。 (Brett Cannon が gh-65961 で貢献しました。) Setting __package__ or __cached__ on a module is deprecated, and will cease to be set or taken into consideration by the import system in Python 3.14. (Co ... ではありませんでした。 (Gregory P. Smith が gh-88168 で貢献しました。) Python 3.15 で削除予定 インポートシステム: Setting __cached__ on a module while failing to set __spec__.cached is deprecated. In Python 3.15, __cached__ will cease to be set or take ... ソースのラッパーなので、メインインタープリタから管理するのが適切です。 (Donghee Na が gh-99127 で貢献しました。) @~functools.cached_property の、ドキュメントに記載のなかったロック動作を削除しました。 クラスのすべてのインスタンスにまたがってロックを取り、 ...
https://man.mtool.work/python/3.14/whatsnew/3.12.html
importlib --- import の実装 7825
importlib --- import の実装 Added in version 3.1. ソースコード: Lib/importlib/__init__.py はじめに importlib パッケージには 3 つの目的があります。 1 つ目は import 文 (ひいては __import__() 関数) の実装を Python のソースコードで提供することで ... module (note that some of these attributes can change when a module is reloaded): module.__name__ module.__file__ module.__cached__ (deprecated) module.__path__ module.__package__ (deprecated) module.__loader__ (deprecated) When exec_module() is availa ... ルのロードに使う追加のモジュール固有データを格納したオブジェクトを設定できます。 それ以外の場合は None に設定してください。 cached The filename of a compiled version of the module's code (see module.__cached__ ). The finder should always set this attrib ...
https://man.mtool.work/python/3.14/library/importlib.html
PREV 1 2 3 NEXT