バージョンごとのドキュメント一覧

46.3. データの共有 #

<title>Sharing Data</title>

The global dictionary <varname>SD</varname> is available to store private data between repeated calls to the same function. The global dictionary <varname>GD</varname> is public data, that is available to all Python functions within a session; use with care.<indexterm><primary>global data</primary> <secondary>in PL/Python</secondary></indexterm> グローバルなSD辞書は、同じ関数に対する繰り返しの呼び出しの間でのプライベートなデータ保存のために使用することができます。 グローバルなGD辞書は、共有データであり、セッション内の全てのPython関数で使用することができます。注意して使用してください。

Each function gets its own execution environment in the Python interpreter, so that global data and function arguments from <function>myfunc</function> are not available to <function>myfunc2</function>. The exception is the data in the <varname>GD</varname> dictionary, as mentioned above. 各関数は、Pythonインタプリタ内で自身の実行環境を入手します。 そのため、myfuncによるグローバルデータと関数の引数はmyfunc2から使用することはできません。 上記で説明した通り、GD辞書内のデータは例外です。