Results of 1 - 9 of about 9 for interpolation (0.011 sec.)
- string.templatelib --- テンプレート文字列リテラルのサポート 13894
- string.templatelib --- テンプレート文字列リテラルのサポート ソースコード: Lib/string/templatelib.py 参考 フォーマット済み文字列リテラル テンプレート文字列リテラル(t-string)の構文 PEP 750 テンプレート文字列 Added in version 3.14. テンプレート
...ます: >>> pi = 3.14 >>> t 't-strings are new in Python { pi !s} !' Template( strings=('t-strings are new in Python ', '!'), interpolations=(Interpolation(3.14, 'pi', 's', ''),) ) 型 class string.templatelib. Template Template クラスはテンプレート文字列の内容を..., sir." >>> type ( template ) <class 'string.templatelib.Template'> テンプレートは、リテラル部分の strings と動的な部分の interpolations のシーケンスとして格納されます。 values 属性は補間される値を保持します。 >>> cheese = 'Camembert' >>> template = t 'Ah! W...e do have { cheese } .' >>> template . strings ('Ah! We do have ', '.') >>> template . interpolations (Interpolation('Camembert', ...),) >>> template . values ('Camembert',) strings タプルは interpolations と values より要素... - https://man.mtool.work/python/3.14/library/string.templatelib.html
- configparser --- 設定ファイルのパーサー 9616
- configparser --- 設定ファイルのパーサー ソースコード: Lib/configparser.py このモジュールは、 Microsoft Windows の INI ファイルに似た構造を持ったベーシックな設定用言語を実装した ConfigParser クラスを提供します。このクラスを使ってユーザーが簡
...) >>> unnamed . get ( configparser . UNNAMED_SECTION , 'option' ) 'value' 値の補間 コア機能に加えて、 ConfigParser は補間(interpolation, 内挿とも)をサポートします。これは get() コールが値を返す前に、その値に対して前処理を行えることを意味します。 class config...parser. BasicInterpolation ConfigParser が使用するデフォルト実装です。値に、同じセクションか特別なデフォルトセクション中 [ 1 ] の他の値を参照するフォ...(my_dir)s/Pictures [Escape] # %% で % 記号をエスケープします (エスケープが必要なのは % だけです): gain : 80%% 上の例では、 interpolation に BasicInterpolation() を設定した ConfigParser が %(home_dir)s を home_dir の値(このケースでは /Users )として解決していま... - https://man.mtool.work/python/3.14/library/configparser.html
- ast --- 抽象構文木 8358
- ast --- 抽象構文木 ソースコード: Lib/ast.py ast モジュールは、Python の抽象構文を表す木を Python アプリケーションで処理するための機能を提供します。 抽象構文自体は Python のリリースごとに変わる可能性がありますが、このモジュールを使えば、現在
...l ( expr func , expr * args , keyword * keywords ) | FormattedValue ( expr value , int conversion , expr ? format_spec ) | Interpolation ( expr value , constant str , int conversion , expr ? format_spec ) | JoinedStr ( expr * values ) | TemplateStr ( expr * v...='.3')]))])) class ast. TemplateStr ( values , / ) Added in version 3.14. テンプレート文字列リテラルを表すノードで、一連の Interpolation ノードと Constant ノードからなります。 これらのノードはどのような順序でもよく、交互に並ぶ必要はありません。 >>> expr = ast...d {place:ordinal}"' , mode = 'eval' ) >>> print ( ast . dump ( expr , indent = 4 )) Expression( body=TemplateStr( values=[ Interpolation( value=Name(id='name', ctx=Load()), str='name', conversion=-1), Constant(value=' finished '), Interpolation( value=Name(id... - https://man.mtool.work/python/3.14/library/ast.html
- What's new in Python 3.14 8304
- What's new in Python 3.14 エディタ : Adam Turner と Hugo van Kemenade この記事では Python 3.13 と比較した Python 3.14 の新機能を解説します。Python 3.14 は2025年10月7日にリリースされました。全詳細については 変更履歴 をご覧ください。 参考 PEP
...前に アクセスできます。 Template インスタンスを反復すると、各部分を順に取得できます。 >>> list ( template ) ['Try some ', Interpolation('Stilton', 'variety', None, ''), ' cheese!'] Template インスタンスを処理するコードは、簡単に書いたり呼び出したりできます。...例えば、次の関数は固定部分を小文字に、 Interpolation インスタンスを大文字にして結果を生成します。 from string.templatelib import Interpolation def lower_upper ( template ): ""..."固定の箇所は小文字に、interpolationsは大文字に変換する""" parts = [] for part in template : if isinstance ( part , Interpolation ): parts . append ( str ( par... - https://man.mtool.work/python/3.14/whatsnew/3.14.html
- dis --- Python バイトコードの逆アセンブラー 8232
- dis --- Python バイトコードの逆アセンブラー ソースコード: Lib/dis.py dis モジュールは、CPython の bytecode を逆アセンブルして解析するためのものです。 このモジュールが入力として受け取る CPython のバイトコードは Include/opcode.h で定義され、コ
...ATE 文字列のタプルと補間のタプルから、新しい Template インスタンスを構築し、結果のオブジェクトをスタックにプッシュします。 interpolations = STACK . pop () strings = STACK . pop () STACK . append ( _build_template ( strings , interpolations )) Added in version...3.14. BUILD_INTERPOLATION ( format ) 値とそのソースの式から新しい Interpolation インスタンスを構築し、結果のオブジェクトをスタックにプッシュします。...spec = STACK . pop () else : format_spec = None expression = STACK . pop () value = STACK . pop () STACK . append ( _build_interpolation ( value , expression , conversion , format_spec )) Added in version 3.14. BUILD_TUPLE ( count ) スタックから count 個の要素... - https://man.mtool.work/python/3.14/library/dis.html
- 組み込み型 8142
- 組み込み型 以下のセクションでは、インタプリタに組み込まれている標準型について記述します。 主要な組み込み型は、数値、シーケンス、マッピング、クラス、インスタンス、および例外です。 コレクションクラスには、ミュータブルなものがあります。コレクシ
...tring.templatelib.Template オブジェクトが得られます。 format() プロトコルは使われません。 代わりに、評価した式ごとに新しい Interpolation オブジェクトが作成され、書式指定子や変換の指定があれば、そのオブジェクトに渡されます。 書式指定子と変換をどのように扱うかは...、結果の Template オブジェクトを処理するコードが決めます。 入れ子になった置換フィールドを含む書式指定子は、 Interpolation オブジェクトに渡される前に即座に評価されます。 例えば、 {amount:.{precision}f} 形式の補間では、内部の式 {precision} を評価...式のテキストが、対応する補間の直前のリテラル文字列に追加されます。 これには等号とその周囲の空白も含まれます。 その式に対する Interpolation インスタンスは通常どおり作成されますが、 conversion はデフォルトで ' r ' ( repr() ) に設定されます。 変換や書式指定子を明示... - https://man.mtool.work/python/3.14/builtins/stdtypes.html
- 変更履歴 8142
- 変更履歴 次の 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
...popitem() on configparser.ConfigParser objects and their section proxies. Clearing a section no longer fails part way with InterpolationError on a value it removes. gh-161102 : Fix the incremental decoder of the idna codec decoding some dots twice when its in...を除外しました。 <> に対する SyntaxError は != を提案するようになりました。 gh-154719 : Trailing whitespace in a t-string interpolation expression is now preserved in string.templatelib.Interpolation.expression , up to the closing } or the conversion ( ! ),...n part of the debug text and are excluded from expression . Escaped quotes are now preserved while reconstructing t-string interpolation metadata and f-string debug text containing comments. gh-153578 : 引数の __buffer__() を取得している間に、別のスレッドなど... - https://man.mtool.work/python/3.14/whatsnew/changelog.html
- What's New In Python 3.2 8088
- What's New In Python 3.2 著者 : Raymond Hettinger この記事では Python 3.1 と比較した Python 3.2 の新機能を説明します。 Python 3.2 は 2011 年 2 月 20 日にリリースされました。 主な変更点をいくつか取り上げ、例を示します。 すべての詳細については
...、あるいは補間の構文を切り替えられます。 抜き挿し可能 (pluggable) な補間サポートがあって、これには追加の補間ハンドラ ExtendedInterpolation が含まれています: >>> parser = ConfigParser ( interpolation = ExtendedInterpolation ()) >>> parser . read_dict ({ 'buildou...onfigParser クラスを長年推奨の代替だった SafeConfigParser に置き換えたことです。 加えて多くの小さな非互換があります: 補間 (interpolation) の構文は今では get() と set() の操作で検証されます。デフォルトの補間スキームでは、パーセント記号を使ったただ二つのトークン... - https://man.mtool.work/python/3.14/whatsnew/3.2.html
- 6. 式 (expression) 8052
- 6. 式 (expression) この章では、Python の式における個々の要素の意味について解説します。 構文上の注意: この章以降では、 文法の表記法 を字句解析ではなく構文の記述に使います。 構文規則の (選択肢の 1 つの) 形式が次のように記述され、 name : other
...mean "=="? True 詳細は いつ is 演算子での同一性テストが頼れますか? を参照してください。 テンプレート文字列 は不変ですが、 Interpolation の値として可変なオブジェクトを参照することがあります。 この節では、2 つの t-string は構造と値の 同一性 の両方が一致する場合...み合わせられるのは、他のテンプレート文字列リテラルだけです。 >>> t "Hello" t " { name } !" Template(strings=('Hello', '!'), interpolations=(...)) 形式的には次のように定義します。 strings : ( STRING | fstring )+ | tstring + 6.2.4. Parenthesized forms A parenthe... - https://man.mtool.work/python/3.14/reference/expressions.html
PREV
1
NEXT