per page, with , order by , clip by
Results of 1 - 10 of about 73 for attribute (0.010 sec.)
stat --- stat() の結果を解釈する 14686
stat --- stat() の結果を解釈する ソースコード: Lib/stat.py stat モジュールは、 os.stat() 、 os.fstat() 、 os.lstat() (利用できる場合) の結果を解釈するための定数と関数を定義します。 stat() 、 fstat() 、 lstat() 呼び出しの詳細は、お使いのシス ... 13. 詳しい情報は *BSD か macOS システムの man page chflags(2) を参照してください。 Windows では、 os.stat() が返す st_file_attributes メンバー内のビットを検証する際に、以下のファイル属性定数を使用できます。これらの定数の意味について詳しくは、 Windows API ... documentation を参照してください。 stat. FILE_ATTRIBUTE_ARCHIVE stat. FILE_ATTRIBUTE_COMPRESSED stat. FILE_ATTRIBUTE_DEVICE stat. FILE_ATTRIBUTE_DIRECTORY stat. FILE_ATTRIBUTE_EN ... CRYPTED stat. FILE_ATTRIBUTE_HIDDEN stat. FILE_ATTRIBUTE_INTEGRITY_STREAM stat. FILE_ATTRIBUTE_NORMAL stat. FILE_ATTRIBUTE_NOT_CONTENT_INDEXED stat. FI ...
https://man.mtool.work/python/3.14/library/stat.html
unittest.mock --- 入門 13261
unittest.mock --- 入門 Added in version 3.3. Mock を使う モックでメソッドにパッチを当てる 一般的な Mock の使い方の中には次のものがあります: メソッドにパッチを当てる オブジェクトに対するメソッド呼び出しを記録する システムの他の部分からメソッ ... しすべてを記録しています。 >>> mock = MagicMock () >>> mock . method () <MagicMock name='mock.method()' id='...'> >>> mock . attribute . method ( 10 , x = 53 ) <MagicMock name='mock.attribute.method()' id='...'> >>> mock . mock_calls [call.method(), call.at ... 便利です: mock_calls と比較するリストを作るために call オブジェクトを利用できます: >>> expected = [ call . method (), call . attribute . method ( 10 , x = 53 )] >>> mock . mock_calls == expected True ただし、モックを返す呼び出しの引数は、その後の入れ子の呼び ... いうキーワード引数で mock の定義となるオブジェクトを指定できます。定義オブジェクトに存在しないメソッドや属性にアクセスすると AttributeError を発生させます。定義となるクラスの実装を変更した場合、テストの中でそのクラスをインスタンス化させなくても、テストを失敗 ...
https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
unittest.mock --- モックオブジェクトライブラリ 11444
unittest.mock --- モックオブジェクトライブラリ Added in version 3.3. ソースコード: Lib/unittest/mock.py unittest.mock は Python でテストを行うためのライブラリです。 テスト対象のシステムの一部をモックオブジェクトに置き換え、どのように使われた ... 引数によって別のオブジェクトからの仕様を受け取るよう設定できます。 spec にないモックの属性やメソッドにアクセスを試みた場合、 AttributeError で失敗します。 patch() デコレータ / コンテキストマネージャーによってテスト対象のモジュール内のクラスやオブジェクトを簡 ... よって文字列のリストが生成されます (サポートされない特殊属性や特殊メソッドは除く) 。このリストにない属性にアクセスした際には AttributeError が発生します。 spec が (文字列のリストではなく) オブジェクトの場合、 __class__ はスペックオブジェクトのクラスを返しま ... 厳しい spec です。こちらを利用した場合、 spec_set に渡されたオブジェクトに存在しない属性に対し 設定 や取得をしようとした際に AttributeError が発生します。 side_effect : モックが呼び出された際に呼び出される関数を指定します。 side_effect 属性を参考にしてくださ ...
https://man.mtool.work/python/3.14/library/unittest.mock.html
2. 拡張の型の定義: チュートリアル 8985
2. 拡張の型の定義: チュートリアル Python では、組み込みの str 型や list 型のような Python コードから操作できる新しい型を C 拡張モジュールの作者が定義できます。 全ての拡張の型のコードはあるパターンに従うのですが、書き始める前に理解しておくべ ... y_UNUSED ( dummy )) { CustomObject * self = ( CustomObject * ) op ; if ( self -> first == NULL ) { PyErr_SetString ( PyExc_AttributeError , "first" ); return NULL ; } if ( self -> last == NULL ) { PyErr_SetString ( PyExc_AttributeError , "last" ); return ... y_UNUSED ( dummy )) { CustomObject * self = ( CustomObject * ) op ; if ( self -> first == NULL ) { PyErr_SetString ( PyExc_AttributeError , "first" ); return NULL ; } if ( self -> last == NULL ) { PyErr_SetString ( PyExc_AttributeError , "last" ); return ... bject * self = ( CustomObject * ) op ; if ( value == NULL ) { PyErr_SetString ( PyExc_TypeError , "Cannot delete the first attribute" ); return -1 ; } if ( ! PyUnicode_Check ( value )) { PyErr_SetString ( PyExc_TypeError , "The first attribute value must ...
https://man.mtool.work/python/3.14/extending/newtypes_tutorial.html
デスクリプタ ガイド 8328
デスクリプタ ガイド Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を使うと、オブジェクトの属性の検索、保存、削除をカスタマイズできます。 本ガイドは4つの大項目から構成されています。 最初の「入門」では基本の紹介をし ... が優先されます。 読み取り専用のデータデスクリプタを作るには、 __get__() と __set__() の両方を定義し、 __set__() が呼ばれたら AttributeError を送出するようにします。 例外を送出するだけの __set__() を定義すれば、データデスクリプタになります。 デスクリプタ呼び ... タが見つかった場合、 desc.__get__(a, type(a)) という形式で呼び出されます。 ドットによるルックアップのロジックは object.__getattribute__() の中で行われます。ピュアPythonで表した等価なロジックは次の通りです。 def find_name_in_mro ( cls , name , default ): "E ... eobject.c" for base in cls . __mro__ : if name in vars ( base ): return vars ( base )[ name ] return default def object_getattribute ( obj , name ): "Emulate PyObject_GenericGetAttr() in Objects/object.c" null = object () objtype = type ( obj ) cls_var = ...
https://man.mtool.work/python/3.14/howto/descriptor.html
監査イベント表 8076
監査イベント表 この表は、 CPython ランタイムと標準ライブラリ全体で sys.audit() または PySys_Audit() の呼び出しによって送出されるすべてのイベントを含んでいます。これらの呼び出しは、 3.8 以降に追加されました ( PEP 578 を参照) 。 これらのイベン ... gs , env [1] os.fork [1] os.forkpty [1] os.fwalk top , topdown , onerror , follow_symlinks , dir_fd [1] os.getxattr path , attribute [1] os.kill pid , sig [1] os.killpg pgid , sig [1] os.link src , dst , src_dir_fd , dst_dir_fd [1] os.listdir path [1] os. ... .posix_spawn path , argv , env [1] [2] os.putenv key , value [1] os.remove path , dir_fd [1] [2] [3] os.removexattr path , attribute [1] os.rename src , dst , src_dir_fd , dst_dir_fd [1] [2] [3] os.rmdir path , dir_fd [1] os.scandir path [1] os.setxattr p ... ath , attribute , value , flags [1] os.spawn mode , path , args , env [1] os.startfile path , operation [1] os.startfile/2 path , operatio ...
https://man.mtool.work/python/3.14/library/audit_events.html
ast --- 抽象構文木 7951
ast --- 抽象構文木 ソースコード: Lib/ast.py ast モジュールは、Python の抽象構文を表す木を Python アプリケーションで処理するための機能を提供します。 抽象構文自体は Python のリリースごとに変わる可能性がありますが、このモジュールを使えば、現在 ... ames ) | Expr ( expr value ) | Pass | Break | Continue -- col_offset is the byte offset in the utf8 string the parser uses attributes ( int lineno , int col_offset , int ? end_lineno , int ? end_col_offset ) -- BoolOp() can use left & right? expr = BoolOp ... pr * values ) | Constant ( constant value , string ? kind ) -- the following expression can appear in assignment context | Attribute ( expr value , identifier attr , expr_context ctx ) | Subscript ( expr value , expr slice , expr_context ctx ) | Starred ( ... | Slice ( expr ? lower , expr ? upper , expr ? step ) -- col_offset is the byte offset in the utf8 string the parser uses attributes ( int lineno , int col_offset , int ? end_lineno , int ? end_col_offset ) expr_context = Load | Store | Del boolop = And ...
https://man.mtool.work/python/3.14/library/ast.html
pickle --- Python オブジェクトの直列化 7811
pickle --- Python オブジェクトの直列化 ソースコード: Lib/pickle.py pickle モジュールは、Python オブジェクト構造を直列化・復元するためのバイナリプロトコルを実装しています。 pickle 化 (pickling) とは Python オブジェクトの階層をバイトストリーム ... 出されるエラー。 PickleError を継承します。 非 picke 化の最中に他の例外が送出されることもあるので注意してください。これには AttributeError, EOFError, ImportError, IndexError が含まれます (ただし必ずしもこれらに限定されません)。 pickle モジュールは Pickler ... れないので、以下の例ではクラス属性 attr が unpickle 化環境で復元されないことに注意してください: class Foo : attr = 'A class attribute' picklestring = pickle . dumps ( Foo ) pickle 化可能な関数やクラスがモジュールのトップレベルで定義されていなければならない ... コードはこの振る舞いの実装を示しています: def save ( obj ): return ( obj . __class__ , obj . __dict__ ) def restore ( cls , attributes ): obj = cls . __new__ ( cls ) obj . __dict__ . update ( attributes ) return obj クラスは、いくつかの特殊メソッドを提供す ...
https://man.mtool.work/python/3.14/library/pickle.html
ctypes --- Python 用の外部関数ライブラリ 7420
ctypes --- Python 用の外部関数ライブラリ ソースコード: Lib/ctypes ctypes は Python 用の外部関数ライブラリです。 C と互換性のあるデータ型を提供し、DLL や共有ライブラリの関数を呼び出せます。 これらのライブラリを純粋な Python でラップするために ... File "<stdin>" , line 1 , in <module> File "ctypes.py" , line 239 , in __getattr__ func = _StdcallFuncPtr ( name , self ) AttributeError : function 'MyOwnFunction' not found >>> kernel32 や user32 などの win32 システム DLL は、関数の ANSI 版と UNICODE 版 ... File "<stdin>" , line 1 , in <module> File "ctypes.py" , line 310 , in __getitem__ func = _StdcallFuncPtr ( name , self ) AttributeError : function ordinal 0 not found >>> 関数を呼び出す これらの関数は、ほかの Python の呼び出し可能オブジェクトと同じように ... ature. Consult the function's C header file or documentation to choose the correct calling convention and set the argtypes attribute, as described in 要求される引数の型を指定する (関数プロトタイプ) . Without argtypes , the number of arguments is not check ...
https://man.mtool.work/python/3.14/library/ctypes.html
xml.dom --- ドキュメントオブジェクトモデル API 7420
xml.dom --- ドキュメントオブジェクトモデル API ソースコード: Lib/xml/dom/__init__.py 文書オブジェクトモデル (Document Object Model)、すなわち "DOM" は、ワールドワイドウェブコンソーシアム (World Wide Web Consortium, W3C) による、XML ドキュメ ... の型を表す整数です。 型を表すシンボル定数は Node オブジェクトにあります。 読み出し専用の属性です。 Node. ELEMENT_NODE Node. ATTRIBUTE_NODE Node. TEXT_NODE Node. CDATA_SECTION_NODE Node. ENTITY_REFERENCE_NODE Node. ENTITY_NODE Node. PROCESSING_INSTRUCTION_N ... の場合には Document オブジェクトとなります。 Attr ノードの場合、この値は常に None となります。読み出し専用の属性です。 Node. attributes 属性オブジェクトの NamedNodeMap です。要素だけがこの属性に実際の値を持ちます; その他のオブジェクトでは、この属性を None に ... tagName None Entity エンティティ名 None Notation 表記名 None ProcessingInstruction target data Text '#text' 内容 Node. hasAttributes ( ) ノードが何らかの属性を持っている場合に True を返します。 Node. hasChildNodes ( ) ノードが何らかの子ノードを持っている ...
https://man.mtool.work/python/3.14/library/xml.dom.html
PREV 1 2 3 4 5 6 7 8 NEXT