per page, with , order by , clip by
Results of 1 - 10 of about 10 for Shape (0.010 sec.)
turtle --- タートルグラフィックス 12228
turtle --- タートルグラフィックス ソースコード: Lib/turtle.py Turtle star 単純な動きを繰り返すプログラムで、タートルは複雑な図形を描けます。 x-y 平面の (0, 0) から動き出す、亀のロボットを想像してください。 import turtle の後に turtle.forwar ... If x or y is not given, that coordinate is kept as it is. The turtle's heading does not change. If the turtle is filling a shape, the shape drawn so far is finished and filled before teleporting, and filling starts again at the new position. Pass fill ... _gap=True to keep filling one shape instead. The teleport then counts as an edge of the shape, as it would with goto() . >>> tp = turtle . pos () >>> tp (0.00 ... r set the line thickness. If width is not given, return the current pensize. If resizemode is set to "auto" and the turtle shape is a polygon, that polygon is drawn with the same line thickness. >>> turtle . pensize () 1 >>> turtle . pensize ( 10 ) # ...
https://man.mtool.work/python/3.14/library/turtle.html
バッファプロトコル (buffer Protocol) 11620
バッファプロトコル (buffer Protocol) Pythonで利用可能ないくつかのオブジェクトは、下層にあるメモリ配列または buffer へのアクセスを提供します。このようなオブジェクトとして、組み込みの bytes や bytearray 、 array.array のようないくつかの拡張型 ... は、このフィールドは NULL です。一般的に、エクスポートオブジェクトはこの方式を使用してはなりません。 Py_ssize_t len product(shape) * itemsize 。contiguous配列では、下層のメモリブロックの長さになります。非contiguous 配列では、contiguous表現にコピーされた ... ORMAT フラグなしでバッファを要求した場合、 format は NULL に設定されますが、 itemsize は元の形式に対応する値を保持します。 shape が存在する場合、 product(shape) * itemsize == len の等式が守られ、利用者は itemsize を buffer を読むために利用できます。 P ... yBUF_SIMPLE または PyBUF_WRITABLE で要求した結果、 shape が NULL であれば、消費者は itemsize を無視して itemsize == 1 と見なさなければなりません。 char * format 単一の要素の内容を ...
https://man.mtool.work/python/3.14/c-api/buffer.html
列挙型 HOWTO 10708
列挙型 HOWTO Enum は、ユニークな値に束縛されたシンボル名の集合です。グローバル変数に似ていますが、 repr() がより便利だったり、グルーピングの機能、型安全などいくつかの機能があります。 これらは、限られた選択肢の値の一つを取る変数がある場合に便 ... r . name 'RED' >>> member . value 1 列挙型メンバーと値の重複 同じ名前の列挙型メンバーを複数持つことはできません: >>> class Shape ( Enum ): ... SQUARE = 2 ... SQUARE = 3 ... Traceback (most recent call last): ... TypeError : 'SQUARE' already defined as ... 、メンバー A が返されます。 A の名前での検索ではメンバー A を返します。 B の名前での検索も、メンバー A を返します: >>> class Shape ( Enum ): ... SQUARE = 2 ... DIAMOND = 1 ... CIRCLE = 3 ... ALIAS_FOR_SQUARE = 2 ... >>> Shape . SQUARE <Shape.SQUARE: 2> ... >>> Shape . ALIAS_FOR_SQUARE <Shape.SQUARE: 2> >>> Shape ( 2 ) <Shape.SQUARE: 2> 注釈 すでに定義されている属性と同じ名前のメンバー ( ...
https://man.mtool.work/python/3.14/howto/enum.html
抽象オブジェクトレイヤ (Abstract Objects Layer) 9063
抽象オブジェクトレイヤ (Abstract Objects Layer) この章で説明する関数は、オブジェクトの型に依存しないような Python オブジェクトの操作や、(数値型全て、シーケンス型全てといった) 大まかな型のオブジェクトに対する操作を行ないます。関数を適用対象で ... ファプロトコル (buffer Protocol) buffer 構造体 バッファリクエストのタイプ リクエストに依存しないフィールド readonly, format shape, strides, suboffsets 隣接性のリクエスト 複合リクエスト 複雑な配列 NumPy スタイル: shape, strides PIL スタイル: shape, stri ...
https://man.mtool.work/python/3.14/c-api/abstract.html
typing --- 型ヒントのサポート 7991
typing --- 型ヒントのサポート Added in version 3.5. ソースコード: Lib/typing.py 注釈 Python ランタイムは、関数や変数の型アノテーションを強制しません。型アノテーションは、 type checkers や IDE、linterなどのサードパーティーツールで使われます。 ... 正しい書き方 型変数タプルは、通常の型変数と同じ文脈で使えます。 例えばクラス定義、引数、戻り値の型などです。 class Array [ * Shape ]: def __getitem__ ( self , key : tuple [ * Shape ]) -> float : ... def __abs__ ( self ) -> "Array[*Shape]" : ... def get_ ... shape ( self ) -> tuple [ * Shape ]: ... 型変数タプルは通常の型変数と組み合わせて使えます: class Array [ DType , * Shape ]: # これは問題ない pass class Arra ... y2 [ * Shape , DType ]: # これも問題ない pass class Height : ... class Width : ... float_array_1d : Array [ float , Height ] = Array () ...
https://man.mtool.work/python/3.14/library/typing.html
multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ 7705
multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ ソースコード Lib/multiprocessing/shared_memory.py Added in version 3.8. このモジュールは、マルチコアもしくは対称型マルチプロセッサ(SMP) を持つマシン上で実行される、ひ ... ry . SharedMemory ( create = True , size = a . nbytes ) >>> # 共有メモリを使う NumPy 配列を作成 >>> b = np . ndarray ( a . shape , dtype = a . dtype , buffer = shm . buf ) >>> b [:] = a [:] # 元のデータを共有メモリにコピー >>> b array([1, 1, 2, 3, 5, ... 存の共有メモリブロックに接続 >>> existing_shm = shared_memory . SharedMemory ( name = 'psm_21467_46075' ) >>> # この例では a.shape は (6,)、a.dtype は np.int64 >>> c = np . ndarray (( 6 ,), dtype = np . int64 , buffer = existing_shm . buf ) >>> c array( ...
https://man.mtool.work/python/3.14/library/multiprocessing.shared_memory.html
スレッドセーフ性の保証 7544
スレッドセーフ性の保証 このページでは、Python のフリースレッドビルドにおける組み込み型のスレッドセーフ性の保証を説明します。 ここで説明する保証は、 GIL を無効にして Python を使う場合 (フリースレッドモード) に適用されます。 GIL が有効な場合、 ... its own exports in the free-threaded build . Creating and releasing a memoryview are thread-safe. Attribute access (e.g., shape , format ) reads fields that are immutable for the lifetime of the memoryview, so concurrent reads are safe as long as the ...
https://man.mtool.work/python/3.14/builtins/threadsafety.html
組み込み関数 7490
組み込み関数 Python インタプリタには数多くの関数と型が組み込まれており、いつでも利用できます。それらをここにアルファベット順に挙げます。 組み込み関数 A abs() aiter() all() anext() any() ascii() B bin() bool() breakpoint() bytearray() bytes( ... _', '__name__', '__package__', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into', 'unpack', 'unpack_from'] >>> class Shape : ... def __dir__ ( self ): ... return [ 'area' , 'perimeter' , 'location' ] ... >>> s = Shape () >>> dir ( s ) ['area', ' ...
https://man.mtool.work/python/3.14/builtins/functions.html
What's New In Python 3.3 7490
What's New In Python 3.3 この記事では 3.2 と比較した Python 3.3 の新機能を解説します。 Python 3.3 は2012年9月29日にリリースされました。全詳細については 変更履歴 をご覧ください。 参考 PEP 398 - Python 3.3 リリーススケジュール 概要 -- リリース ... 良いです)。 (訳注: format 参照。) いくつかの制限はありますが、 cast() メソッドでフォーマット変更と C-contiguous 配列の形状 (shape) の変更を行うことが出来ます。 任意の配列型で多次元のリスト表現がサポートされるようになっています。 任意の配列型で多次元の比 ... 例えば、負のステップを使うと O (1) で memoryview を反転できます。 API の変更 最大 次元 は公式に 64 に制限されています。 空の shape , 空の strides , 空の suboffsets を表現するのに以前は None を用いていましたが今ではこれは空のタプルです。 フォーマット 'B' ...
https://man.mtool.work/python/3.14/whatsnew/3.3.html
型オブジェクトの構造体 7437
型オブジェクトの構造体 新しい型を定義する PyTypeObject 構造体は、Python のオブジェクトシステムで特に重要な構造体の 1 つです。 型オブジェクトは PyObject_* 関数や PyType_* 関数で扱えますが、ほとんどの Python アプリケーションにとって関心のある ... 構造体の中から参照している全てのメモリはエクスポータに属し、コンシューマがいなくなるまで有効でなくてはなりません。 format 、 shape 、 strides 、 suboffsets 、 internal はコンシューマからは読み出し専用です。 PyBuffer_FillInfo() は、全てのリクエストタイプ ...
https://man.mtool.work/python/3.14/c-api/typeobj.html
PREV 1 NEXT