Results of 1 - 10 of about 20 for mutable (0.010 sec.)
- プログラミング FAQ 13747
- プログラミング FAQ 一般的な質問 ブレークポイントやステップ実行ができる、ソースコードレベルのデバッガはありますか? はい。 Python 用のデバッガについては次に解説してあり、組み込みの breakpoint() 関数でそれらのデバッガに処理を移せます。 pdb モジ
...ります。つまり、あるのは一つのオブジェクト(この場合リスト)だけであって、 x と y の両方がそれを参照しているのです。 リストは mutable です。内容を変更出来る、ということです。 append() 呼び出しの後、ミュータブルオブジェクトの内容が [] から [10] に変わります...では新しいオブジェクトを作っている >>> x 6 >>> y 5 この場合ご覧の通り x と y はまったく同じではありませんね。これは整数が immutable だからで、 x = x + 1 は整数の 5 の値を変更しているのではありません; 代わりに新しいオブジェクト(整数 6 )を作って x に代入し...で、そして a_list を変更しますが、 some_tuple += (1, 2, 3) と some_int += 1 は新しいオブジェクトを作ります)。 言い換えると: mutable オブジェクト ( list , dict , set のような) の場合は、特定の操作を用いてそれを変えることができ、それを参照する どの変数にも... - https://man.mtool.work/python/3.14/faq/programming.html
- 3. データモデル 10740
- 3. データモデル 3.1. オブジェクト、値、および型 オブジェクト は、Python がデータを抽象化したものです。 Python プログラム内のすべてのデータは、オブジェクトまたはオブジェクト間の関係として表されます。 コードもオブジェクトで表されます。 すべて
...の型( type ) も変更不可能です。 [ 1 ] オブジェクトによっては 値 を変更することが可能です。値を変更できるオブジェクトのことを mutable と呼びます。生成後に値を変更できないオブジェクトのことを immutable と呼びます。(mutable なオブジェクトへの参照を格納してい...る immutableなコンテナオブジェクトの値は、その格納しているオブジェクトの値が変化した時に変化しますが、コンテナがどのオブジェクトを格納し...ているのかが変化しないのであれば immutable だと考えることができます。したがって、immutable かどうかは値が変更可能かどうかと完全に一致するわけではありません) オブジェ... - https://man.mtool.work/python/3.14/reference/datamodel.html
- 拡張モジュールを分離する 9992
- 拡張モジュールを分離する 概要 従来、Python 拡張モジュールの状態は、プロセス全体をスコープとする C の static 変数に保持されていました。 このドキュメントでは、プロセスごとの状態が抱える問題と、より安全な方法であるモジュールごとの状態について説
...Python レベルでは不変になっています。 例えば str.myattribute = 123 は設定できません。 CPython 実装の詳細: Sharing truly immutable objects between interpreters is fine, as long as they don't provide access to mutable objects. However, in CPython, every...Python object has a mutable implementation detail: the reference count. Changes to the refcount are guarded by the GIL. Thus, code that shares any Pyt...ですべてではありません): 静的な型とは異なり、ヒープ型のオブジェクトはデフォルトで可変です。 変更を禁止するには Py_TPFLAGS_IMMUTABLETYPE フラグを使ってください。 ヒープ型はデフォルトで tp_new を継承するため、Python コードからインスタンスを作成できるように... - https://man.mtool.work/python/3.14/howto/isolating-extensions.html
- What's New in Python 2.7 9992
- What's New in Python 2.7 著者 : A.M. Kuchling (amk at amk.ca) この文書は Python 2.7 の新機能について解説します。Python 2.7 は 2010 年 7 月 3 日にリリースされました。 数値周りの扱いが、浮動小数点数でも Decimal クラスでもいろいろな点で改良され
...行のためのツールを提供し続けています。 Python 2.7 に取り込まれた 3.1 の機能の不完全なリスト: 集合のリテラル文法 ( {1,2,3} は mutable set になります) 辞書と集合の内包表記 ( {i: i*2 for i in range(3)} ). 1つの with 文で複数のコンテキストマネージャを扱えるよ...t () [97, 98, 99, 100, 101, 102, 103, ... 121, 122] >>> memoryview オブジェクトは、対象となる背後のオブジェクトが変更可能 (mutable) な場合は、その変更を許可しています。 >>> m2 [ 0 ] = 75 Traceback (most recent call last): File "<stdin>" , line 1 , in <m...ーへの代入で bytearray を変更する。 >>> b [ 0 : 5 ] # bytearray が変更されている。 bytearray(b'*bcde') >>> 参考 PEP 3137 - Immutable Bytes and Mutable Buffer PEP written by Guido van Rossum. Implemented by Travis Oliphant, Antoine Pitrou and others. Backp... - https://man.mtool.work/python/3.14/whatsnew/2.7.html
- 組み込み型の操作の時間計算量 9244
- 組み込み型の操作の時間計算量 このページでは、CPython の組み込み型に対するさまざまな操作の時間計算量を説明します。 ほかの Python 実装では、性能の特性が異なる場合があります。 また、サブクラスのインスタンスではコストが異なる場合があるため、ここ
...り、 n は現在コンテナに含まれる要素の数を表し、 k はインデックスや繰り返し回数などの数値引数の値を表します。 list Lists are mutable sequences; for more detail on the implementation see CPythonでリストはどのように実装されているのですか? . The largest cost... - https://man.mtool.work/python/3.14/builtins/time-complexity.html
- Function オブジェクト 9244
- Function オブジェクト Functionオブジェクト固有の関数はわずかです。 type PyFunctionObject 関数に使われるCの構造体。 In the free-threaded build, direct access to mutable fields requires synchronization if another thread may modify the functio
... - https://man.mtool.work/python/3.14/c-api/function.html
- array --- 効率的な数値配列 9244
- array --- 効率的な数値配列 This module defines an object type which can compactly represent an array of basic values: characters, integers, floating-point numbers. Arrays are mutable sequence types and behave very much like lists, except th
... - https://man.mtool.work/python/3.14/library/array.html
- fcntl --- fcntl および ioctl システムコール 9244
- fcntl --- fcntl および ioctl システムコール このモジュールはファイル記述子に対するファイル制御と I/O 制御を行います。 Unix の fcntl() と ioctl() ルーチンへのインターフェイスです。 詳細は Unix のマニュアルページ fcntl(2) と ioctl(2) を参照し
...expected, or the information returned in the buffer by the operating system is larger than 1024 bytes, or the size of the mutable bytes-like object is too small), this is most likely to result in a segmentation violation or a more subtle data corruptio... - https://man.mtool.work/python/3.14/library/fcntl.html
- 6. 式 (expression) 8496
- 6. 式 (expression) この章では、Python の式における個々の要素の意味について解説します。 構文上の注意: この章以降では、 文法の表記法 を字句解析ではなく構文の記述に使います。 構文規則の (選択肢の 1 つの) 形式が次のように記述され、 name : other
...xpression that makes up the expression list. An empty pair of parentheses yields an empty tuple object. Since tuples are immutable, the same rules as for literals apply (i.e., two occurrences of the empty tuple may or may not yield the same object). Not...separating keys and values: set_display : "{" ( flexible_expression_list | comprehension ) "}" A set display yields a new mutable set object, the contents being specified by either a sequence of expressions or a comprehension. When a comma-separated li...ey values are listed earlier in section 標準型の階層 . (To summarize, the key type should be hashable , which excludes all mutable objects.) Clashes between duplicate keys are not detected; the last value (textually rightmost in the display) stored for... - https://man.mtool.work/python/3.14/reference/expressions.html
- デザインと歴史 FAQ 7732
- デザインと歴史 FAQ Python はなぜ文のグループ化にインデントを使うのですか? Guido van Rossum の信じるところによれば、インデントによるグループ化は非常にエレガントで、普通の Python プログラムを大いに読みやすくします。しばらくすればほとんどの人は
...リストを返します。この出力を演算する関数は一般に、ディレクトリに一つや二つの別のファイルを加えても壊れません。 Tuples are immutable, meaning that once a tuple has been created, you can't replace any of its elements with a new value. Lists are mutable, me...aning that you can always change a list's elements. Only immutable elements can be used as dictionary keys, and hence only tuples and not lists can be used as keys. CPythonでリストはどのよう...ンスやクラスが、ある ABC を実装しているかどうかチェックできます。 collections.abc モジュールでは、 Iterable 、 Container 、 MutableMapping などの便利な ABC が定義されています。 Pythonでは、インターフェース仕様の多くの利点は、コンポーネントへの適切なテスト... - https://man.mtool.work/python/3.14/faq/design.html