per page, with , order by , clip by
Results of 1 - 10 of about 12 for imports (0.009 sec.)
pickle --- Python オブジェクトの直列化 14327
pickle --- Python オブジェクトの直列化 ソースコード: Lib/pickle.py pickle モジュールは、Python オブジェクト構造を直列化・復元するためのバイナリプロトコルを実装しています。 pickle 化 (pickling) とは Python オブジェクトの階層をバイトストリーム ... e モジュールは、pickle 化をより便利に行うために次の関数を提供します: pickle. dump ( obj , file , protocol = None , * , fix_imports = True , buffer_callback = None ) オブジェクト obj を pickle 化し、すでにオープンしている ファイルオブジェクト file に書き ... 込みます。 Pickler(file, protocol).dump(obj) と等価です。 引数 file , protocol , fix_imports および buffer_callback は Pickler のコンストラクタと同じ意味になります。 バージョン 3.8 で変更: buffer_callback 引数が追加 ... されました。 pickle. dumps ( obj , protocol = None , * , fix_imports = True , buffer_callback = None ) ファイルに書く代わりに、 bytes オブジェクトとしてオブジェクト obj の pickle 表現を返しま ...
https://man.mtool.work/python/3.14/library/pickle.html
What's New In Python 3.1 9745
What's New In Python 3.1 著者 : Raymond Hettinger この記事では Python 3.0 と比較した Python 3.1 の新機能を説明します。 Python 3.1 は 2009 年 6 月 27 日にリリースされました。 PEP 372: 順序付き辞書 通常の Python 辞書は、 key/value ペアを不定の ... は自動的にロード時もダンプ時も古い Python 2 命名を使うようになります。この再マッピングはデフォルトで有効になりますが、 fix_imports オプションで無効に出来ます: >>> s = { 1 , 2 , 3 } >>> pickle . dumps ( s , protocol = 0 ) b'c__builtin__\nset\np0\n((lp1\n ... L1L\naL2L\naL3L\natp2\nRp3\n.' >>> pickle . dumps ( s , protocol = 0 , fix_imports = False ) b'cbuiltins\nset\np0\n((lp1\nL1L\naL2L\naL3L\natp2\nRp3\n.' 不幸にも、そして避けられないこの変更による副作用は、 ... .int_info が追加されましたが、これにより数字あたりのビット数と各数字の格納に使われる C の型のバイトサイズが分かります: >>> import sys >>> sys . int_info sys.int_info(bits_per_digit=30, sizeof_digit=4) (Contributed by Mark Dickinson; bpo-4258 .) PyLong_A ...
https://man.mtool.work/python/3.14/whatsnew/3.1.html
__future__ --- future 文の定義 9162
__future__ --- future 文の定義 ソースコード: Lib/__future__.py from __future__ import feature の形式でのインポートは future 文 の定義と呼ばれています。これらは特殊なケースで、 Python の新機能が標準になるリリースの前に Python コンパイラーが ... _future__. division 2.2.0a2 3.0 PEP 238 : Changing the Division Operator __future__. absolute_import 2.5.0a1 3.0 PEP 328 : Imports: Multi-Line and Absolute/Relative __future__. with_statement 2.5.0a1 2.6 PEP 343 : 「with」文 __future__. print_function 2 ...
https://man.mtool.work/python/3.14/library/__future__.html
拡張モジュールの定義 8879
拡張モジュールの定義 A C extension for CPython is a shared library (for example, a .so file on Linux, .pyd DLL on Windows), which is loadable into the Python process (for example, it is compiled with compatible compiler settings), and which ... Python saves the contents of the module's __dict__ (that is, typically, the module's functions and types). For subsequent imports, Python does not call the initialization function again. Instead, it creates a new module object with a new __dict__ , and ... example, given a single-phase module _testsinglephase [ 1 ] that defines a function sum and an exception class error : >>> import sys >>> import _testsinglephase as one >>> del sys . modules [ '_testsinglephase' ] >>> import _testsinglephase as two >>> ...
https://man.mtool.work/python/3.14/c-api/extension-modules.html
組み込み関数 8596
組み込み関数 Python インタプリタには数多くの関数と型が組み込まれており、いつでも利用できます。それらをここにアルファベット順に挙げます。 組み込み関数 A abs() aiter() all() anext() any() ascii() B bin() bool() breakpoint() bytearray() bytes( ... ラス属性名、再帰的にたどった基底クラスの属性名が含まれます。 返されるリストはアルファベット順に並べられています。例えば: >>> import struct >>> dir () # show the names in the module namespace ['__builtins__', '__name__', 'struct'] >>> dir ( struct ) # show ... port 文のパッケージコンテキストを決めるためにのみ globals を使います。 level specifies whether to use absolute or relative imports. 0 (the default) means only perform absolute imports. For relative imports, 1 refers to the current package, 2 to its pare ... 前) が返されます。しかしながら、空でない fromlist 引数が与えられると、 name で指名されたモジュールが返されます。 例えば、文 import spam は、以下のコードのようなバイトコードに帰結します: spam = __import__ ( 'spam' , globals (), locals (), [], 0 ) 文 impor ...
https://man.mtool.work/python/3.14/builtins/functions.html
1. Extending Python with C or C++ 8313
1. Extending Python with C or C++ It is quite easy to add new built-in modules to Python, if you know how to program in C. Such extension modules can do two things that can't be done directly in Python: they can implement new built-in objec ... ated character string as argument and returns an integer. We want this function to be callable from Python as follows: >>> import spam >>> status = spam . system ( "ls -l" ) Begin by creating a file spammodule.c . (Historically, if a module is called sp ... required by the platform, and for C++ declares the function as extern "C" . PyInit_spam() is called when each interpreter imports its module spam for the first time. (See below for comments about embedding Python.) A pointer to the module definition mu ... onfig_Clear ( & config ); /* Optionally import the module; alternatively, import can be deferred until the embedded script imports it. */ PyObject * pmodule = PyImport_ImportModule ( "spam" ); if ( ! pmodule ) { PyErr_Print (); fprintf ( stderr , "Error ...
https://man.mtool.work/python/3.14/extending/extending.html
インタープリタの初期化と終了処理 8030
インタープリタの初期化と終了処理 初期化前にインタープリタを設定する方法の詳細は、 Python の初期化設定 を参照してください。 Python の初期化前 Python を組み込むアプリケーションでは、一部の関数と グローバルな設定変数 を除き、ほかの Python/C AP ... f the program's modules, as produced by the freeze utility; see Tools/freeze ). This function initializes the interpreter, imports the frozen module named __main__ , and finalizes the interpreter. The frozen modules must have been registered in PyImport ... が完了した後に sys.path の先頭の要素を取り出すことで、同じ効果が得られます。例えばこのように使います: PyRun_SimpleString ( "import sys; sys.path.pop(0) \n " ); Added in version 3.1.3. バージョン 3.11 で非推奨、バージョン 3.15 で削除予定. void PySys_SetAr ...
https://man.mtool.work/python/3.14/c-api/interp-lifecycle.html
xml.dom --- ドキュメントオブジェクトモデル API 8030
xml.dom --- ドキュメントオブジェクトモデル API ソースコード: Lib/xml/dom/__init__.py 文書オブジェクトモデル (Document Object Model)、すなわち "DOM" は、ワールドワイドウェブコンソーシアム (World Wide Web Consortium, W3C) による、XML ドキュメ ... DOM implementation. The name is either well-known, the module name of a DOM implementation, or None . If it is not None , imports the corresponding module and returns a DOMImplementation object if the import succeeds. If no name is given, and if the en ...
https://man.mtool.work/python/3.14/library/xml.dom.html
test --- Python の回帰テストパッケージ 7729
test --- Python の回帰テストパッケージ 注釈 test パッケージは Python 内部での使用のみを目的としています。 このドキュメントは Python のコア開発者向けに用意されています。 ここで説明するコードは Python のリリース間で予告なく変更または削除される ... 出力され、どのテストを実行しているかが表示されなくなるためです。 以下のような決まり文句を使います: import unittest from test import support class MyTestCase1 ( unittest . TestCase ): # setUp() と tearDown() は必要な場合だけ使う def setUp ( self ): ... cod ... ても公開 API の一部として扱ってはいけない名前の集合を指定できます。 使用例: import bar import foo import unittest from test import support class MiscTestCase ( unittest . TestCase ): def test__all__ ( self ): support . check__all__ ( self , foo ) class O ... す。 test.support.import_helper. import_fresh_module ( name , fresh = () , blocked = () , deprecated = False ) This function imports and returns a fresh copy of the named Python module by removing the named module from sys.modules before doing the import. ...
https://man.mtool.work/python/3.14/library/test.html
5. インポートシステム 7729
5. インポートシステム ある 1 つの module にある Python コードから他のモジュールを インポート することで、そこにあるコードへアクセスできるようになります。 import 文はインポート機構を動かす最も一般的な方法ですが、それが唯一の方法ではありません ... ule() に渡されたモジュールは、インポートの終わりに返されるものとは異なるかもしれません [ 2 ] 。 バージョン 3.4 で変更: The import system has taken over the boilerplate responsibilities of loaders. These were previously performed by the importlib.abc.Loa ... from .foo import Foo このとき、以下を実行することにより spam モジュールの中に foo と Foo に束縛された名前が置かれます: >>> import spam >>> spam . foo <module 'spam.foo' from '/tmp/imports/spam/foo.py'> >>> spam . Foo <class 'spam.foo.Foo'> Python の慣れ ... moduleA . py subpackage1/moduleX.py と subpackage1/__init__.py のどちらでも、次の相対インポートは有効です。 from .moduleY import spam from .moduleY import spam as ham from . import moduleY from ..subpackage1 import moduleY from ..subpackage2.moduleZ im ...
https://man.mtool.work/python/3.14/reference/import.html
PREV 1 2 NEXT