Search
Searching for multiple words only shows matches that contain all words.
Search Results
Search finished, found 134 pages matching the search query.
- json.loads (Python function, in
json
— JSON encoder and decoder) - marshal.loads (Python function, in
marshal
— Internal Python object serialization) - pickle.loads (Python function, in
pickle
— Python object serialization) - plistlib.loads (Python function, in
plistlib
— Generate and parse Apple.plist
files) - tomllib.loads (Python function, in
tomllib
— Parse TOML files) - xmlrpc.client.loads (Python function, in
xmlrpc.client
— XML-RPC client access) ctypes
— A foreign function library for Python...long. So, you should not be confused if c_long is printed if you would expect c_int — they are actually the same type. Loading dynamic link libraries ctypes exports the cdll, and on Windows windll and oledll objects, for loading dynamic li...
unittest
— Unit testing framework...e substring matching is used. Patterns are matched against the fully qualified test method name as imported by the test loader. For example, -k foo matches foo_tests.SomeTest.test_something, bar_tests.SomeTest.test_foo, but not bar_tests.Fo...
- 5. The import system
...sys.modules, and then re-import the named module, the two module objects will not be the same. By contrast, importlib.reload() will reuse the same module object, and simply reinitialise the module contents by rerunning the module’s code....
- Tkinter Dialogs
...tkinter.filedialog module provides classes and factory functions for creating file/directory selection windows. Native Load/Save Dialogs The following classes and functions provide file dialog windows that combine a native look-and-feel wi...
- typing.clear_overloads (Python function, in
typing
— Support for type hints) - typing.get_overloads (Python function, in
typing
— Support for type hints) ast
— Abstract Syntax Trees...parser uses attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) expr_context = Load | Store | Del boolop = And | Or operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift...
cmd
— Support for line-oriented command interpreters...intro string to be issued before the first prompt (this overrides the intro class attribute). If the readline module is loaded, input will automatically inherit bash-like history-list editing (e.g. Control-P scrolls back to the last command...
concurrent.futures
— Launching parallel tasks...uk/', 'http://nonexistent-subdomain.python.org/'] # Retrieve a single page and report the URL and contents def load_url(url, timeout): with urllib.request.urlopen(url, timeout=timeout) as conn: return conn.read() # We...
configparser
— Configuration file parser...les exist, the ConfigParser instance will contain an empty dataset. An application which requires initial values to be loaded from a file should load the required file or files using read_file() before calling read() for any optional files...
dbm
— Interfaces to Unix “databases”...0o666), used only when the database has to be created. Warning It is possible to crash the Python interpreter when loading a database with a sufficiently large/complex entry due to stack depth limitations in Python’s AST compiler. Ch...
dis
— Disassembler for Python bytecode...sed to display the disassembly of myfunc(): >>> dis.dis(myfunc) 2 RESUME 0 3 LOAD_GLOBAL 1 (len + NULL) LOAD_FAST 0 (alist) CALL...
doctest
— Test interactive Python examples...test test suites from modules and text files containing doctests. To integrate with unittest test discovery, include a load_tests function in your test module: import unittest import doctest import my_module_with_doctests def load_tests(l...
ftplib
— FTP protocol client...Error. See also Module netrcParser for the .netrc file format. The file .netrc is typically used by FTP clients to load user authentication information before prompting the user.
http.cookiejar
— Cookie handling for HTTP clients...module uses the term cookie-attribute instead. The module defines the following exception: exception http.cookiejar.LoadError Instances of FileCookieJar raise this exception on failure to load cookies from a file. LoadError is a subcla...
http.cookies
— HTTP state management...alue, the value is first converted to a Morsel containing the key and the value. If input is given, it is passed to the load() method. class http.cookies.SimpleCookie([input]) This class derives from BaseCookie and overrides value_decod...
importlib.metadata
– Accessing package metadata...ntryPoint Details of an installed entry point. Each EntryPoint instance has .name, .group, and .value attributes and a .load() method to resolve the value. There are also .module, .attr, and .extras attributes for getting the components of...
importlib.resources.abc
– Abstract base classes for resources...pected to directly correlate to a specific package (instead of potentially representing multiple packages or a module). Loaders that wish to support resource reading are expected to provide a method called get_resource_reader(fullname) whic...
importlib
— The implementation ofimport
.../installed in a different sys.path location after the same namespace was already imported are noticed. importlib.reload(module) Reload a previously imported module. The argument must be a module object, so it must have been successful...
json
— JSON encoder and decoder...+ 2j, default=custom_json) '{"__complex__": true, "real": 1.0, "imag": 2.0}' Decoding JSON: >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('"\\"foo\\bar"')...
logging.config
— Logging configuration...user to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration). It will raise FileNotFoundError if the file doesn’t exist and RuntimeError if the file i...
logging
— Logging facility for Python...ed %(relativeCreated)d Time in milliseconds when the LogRecord was created, relative to the time the logging module was loaded. stack_info You shouldn’t need to format this yourself. Stack frame information (where available) from the botto...
marshal
— Internal Python object serialization...exception is raised — but garbage data will also be written to the file. The object will not be properly read back by load(). Code objects are only supported if allow_code is true. The version argument indicates the data format that dump...
mimetypes
— Map filenames to MIME types...t type map. If omitted, the file names to use are taken from knownfiles; on Windows, the current registry settings are loaded. Each file named in files or knownfiles takes precedence over those named before it. Calling init() repeatedly...
modulefinder
— Find modules used by a script...eport of bacon.py: from modulefinder import ModuleFinder finder = ModuleFinder() finder.run_script('bacon.py') print('Loaded modules:') for name, mod in finder.modules.items(): print('%s: ' % name, end='') print(','.join(list(mod....
multiprocessing.shared_memory
— Shared memory for direct access across processes...sl = shared_memory.ShareableList(range(10)) >>> list(sl) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> deserialized_sl = pickle.loads(pickle.dumps(sl)) >>> list(deserialized_sl) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> sl[0] = -1 >>> deserialized_sl[1]...
os
— Miscellaneous operating system interfaces...ns may be used to create and manage processes. The various exec* functions take a list of arguments for the new program loaded into the process. In each case, the first of these arguments is passed to the new program as its own name rather...
pdb
— The Python Debugger...t to touch the SIGINT handler, set nosigint to true. The readrc argument defaults to true and controls whether Pdb will load .pdbrc files from the filesystem. Example call to enable tracing with skip: import pdb; pdb.Pdb(skip=['django.*'])....
pickle
— Python object serialization...alize an object hierarchy, you simply call the dumps() function. Similarly, to de-serialize a data stream, you call the loads() function. However, if you want more control over serialization and de-serialization, you can create a Pickler or...
pkgutil
— Package extension utility...ed as filenames may cause this function to raise an exception (in line with os.path.isdir() behavior). pkgutil.find_loader(fullname) Retrieve a module loader for the given fullname. This is a backwards compatibility wrapper around impor...
plistlib
— Generate and parse Apple.plist
files...and strings. Usually the top level object is a dictionary. To write out and to parse a plist file, use the dump() and load() functions. To work with plist data in bytes or string objects, use dumps() and loads(). Values can be strings, in...
pprint
— Data pretty printer...eter. If the formatted structures include objects which are not fundamental Python types, the representation may not be loadable. This may be the case if objects such as files, sockets or classes are included, as well as many other objects...
py_compile
— Compile Python source files...nMode.TIMESTAMP, quiet=0) Compile a source file to byte-code and write out the byte-code cache file. The source code is loaded from the file named file. The byte-code is written to cfile, which defaults to the PEP 3147/PEP 488 path, ending...
readline
— GNU readline interface...g used at run time. The configuration file for editline is different from that of GNU readline. If you programmatically load configuration strings you can use backend to determine which library is being used. If you use editline/libedit rea...
shelve
— Python object persistence...n('spam') as db: db['eggs'] = 'eggs' Warning Because the shelve module is backed by pickle, it is insecure to load a shelf from an untrusted source. Like with pickle, loading a shelf can execute arbitrary code. Shelf objects sup...
site
— Site-specific configuration hook...kept to a minimum. The primary intended purpose of executable lines is to make the corresponding module(s) importable (load 3rd-party import hooks, adjust PATH etc). Any other initialization is supposed to be done upon a module’s actual im...
sqlite3
— DB-API 2.0 interface for SQLite databases...DML sqlite3.SQLITE_DBCONFIG_ENABLE_FKEY sqlite3.SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER sqlite3.SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION sqlite3.SQLITE_DBCONFIG_ENABLE_QPSG sqlite3.SQLITE_DBCONFIG_ENABLE_TRIGGER sqlite3.SQLITE_DBCONFIG_ENA...
ssl
— TLS/SSL wrapper for socket objects...# PROTOCOL_TLS_CLIENT requires valid cert chain and hostname context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) context.load_verify_locations('path/to/cabundle.pem') with socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) as sock: wi...
sys
— System-specific parameters and functions...irectory exec_prefix/lib/pythonX.Y/config, and shared library modules are installed in exec_prefix/lib/pythonX.Y/lib-dynload, where X.Y is the version number of Python, for example 3.2. Note If a virtual environment is in effect, this valu...
test
— Regression tests package for Python...dules in the package whose name starts with test_, importing them, and executing the function test_main() if present or loading the tests via unittest.TestLoader.loadTestsFromModule if test_main does not exist. The names of tests to execut...
time
— Time access and conversions...constants (altzone, daylight, timezone, and tzname), the value is determined by the timezone rules in effect at module load time or the last time tzset() is called and may be incorrect for times in the past. It is recommended to use the t...
tkinter
— Python interface to Tcl/Tk...ds custom commands to create and manipulate GUI widgets. Each Tk object embeds its own Tcl interpreter instance with Tk loaded into it. Tk’s widgets are very customizable, though at the cost of a dated appearance. Tk uses Tcl’s event queue...
tomllib
— Parse TOML files...cement for this module for editing already existing TOML files. This module defines the following functions: tomllib.load(fp, /, *, parse_float=float) Read a TOML file. The first argument should be a readable and binary file object. Retu...
tracemalloc
— Trace memory allocations...8, average=344 B /usr/lib/python3.4/sysconfig.py:411: size=48.0 KiB, count=1, average=48.0 KiB We can see that Python loaded 4855 KiB data (bytecode and constants) from modules and that the collections module allocated 244 KiB to build na...
turtle
— Turtle graphics...to use resizemode = auto. If you set e.g. language = italian the docstringdict turtle_docstringdict_italian.py will be loaded at import time (if present on the import path, e.g. in the same directory as turtle). The entries exampleturtle a...
winreg
— Windows registry access...stry changes are on disk. Note If you don’t know whether a FlushKey() call is required, it probably isn’t. winreg.LoadKey(key, sub_key, file_name) Creates a subkey under the specified key and stores registration information from a spe...
xml.dom
— The Document Object Model API...Document object. In Python, each DOM implementation will provide a function getDOMImplementation(). DOM Level 3 adds a Load/Store specification, which defines an interface to the reader, but this is not yet available in the Python standard...
xml.etree.ElementTree
— The ElementTree XML API...="source.xml" parse="xml" /> </document> By default, the href attribute is treated as a file name. You can use custom loaders to override this behaviour. Also note that the standard helper does not support XPointer syntax. To process this...
xml.parsers.expat
— Fast XML parsing using Expat...ault) will cause Expat to call the ExternalEntityRefHandler with None for all arguments to allow an alternate DTD to be loaded. If the document does not contain a document type declaration, the ExternalEntityRefHandler will still be called...
xml.sax
— Support for SAX2 parsers...ernal entities by default to increase security. Before, the parser created network connections to fetch remote files or loaded local files from the file system for DTD and entities. The feature can be enabled again with method setFeature()...
xmlrpc.client
— XML-RPC client access...alling the method performs an RPC, dispatched by both name and argument signature (e.g. the same method name can be overloaded with multiple argument signatures). The RPC finishes by returning a value, which may be either returned data in...
xmlrpc.server
— Basic XML-RPC servers...te the allow_reuse_address class variable before the address is bound. The use_builtin_types parameter is passed to the loads() function and controls which types are processed when date/times values or binary data are received; it defaults...
zipapp
— Manage executable Python zip archives...annot be run from a zip file (this is an OS limitation, as executable code must be present in the filesystem for the OS loader to load it). In this case, you can exclude that dependency from the zipfile, and either require your users to hav...
zipimport
— Import modules from Zip archives...). ZipImportError is raised if archivepath doesn’t point to a valid ZIP archive. Changed in version 3.12: Methods find_loader() and find_module(), deprecated in 3.10 are now removed. Use find_spec() instead. create_module(spec) Impleme...
zlib
— Compression compatible with gzip...ich is available as ZLIB_RUNTIME_VERSION. zlib.ZLIB_RUNTIME_VERSION The version string of the zlib library actually loaded by the interpreter. Added in version 3.3. See also Module gzipReading and writing gzip-format files. http:...
zoneinfo
— IANA time zone support...om ZoneInfo("Europe/Berlin"), one would expect the following behavior: >>> a = ZoneInfo("Europe/Berlin") >>> b = pickle.loads(europe_berlin_pkl) >>> a is b True ZoneInfo.no_cache(key): When constructed from the cache-bypassing constructo...
- 1. Command line and environment
...-v Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (-vv), print a message for each file that is checked for when searching for a module. Also pr...
- 1. Embedding Python in Another Application
...can better be done by using the PyRun_SimpleFile() function, which saves you the trouble of allocating memory space and loading the file contents. 1.2. Beyond Very High Level Embedding: An overview The high level interface gives you the a...
- 1. Extending Python with C or C++
...hings to do before you can use your new extension: compiling and linking it with the Python system. If you use dynamic loading, the details may depend on the style of dynamic loading your system uses; see the chapters about building extens...
- 10. Full Grammar specification
...10. Full Grammar specification This is the full Python grammar, derived directly from the grammar used to generate the CPython parser (see Grammar/python.gram). The version here omits details related to code generation and
- 11. Brief Tour of the Standard Library — Part II
...riority: DEBUG, INFO, WARNING, ERROR, and CRITICAL. The logging system can be configured directly from Python or can be loaded from a user editable configuration file for customized logging without altering the application. 11.6. Weak Ref...
- 3. Data model
...the machinery associated with the import system, these attributes are filled in based on the module’s spec, before the loader executes and loads the module. To create a module dynamically rather than using the import system, it’s recommend...
- 4. Using Python on Windows
...rger application. 4.1. The full installer 4.1.1. Installation steps Four Python 3.13 installers are available for download - two each for the 32-bit and 64-bit versions of the interpreter. The web installer is a small initial download, an...
- 5. Building C and C++ Extensions on Windows
...ry module. 5.2. Differences Between Unix and Windows Unix and Windows use completely different paradigms for run-time loading of code. Before you try to build a module that can be dynamically loaded, be aware of how your system works. In...
- 6. Modules
...modules, you must restart the interpreter – or, if it’s just one module you want to test interactively, use importlib.reload(), e.g. import importlib; importlib.reload(modulename). 6.1.1. Executing modules as scripts When you run a Python...
- 7. Input and Output
...'};' for k in table.keys()]) >>> print(message.format(**table)) __name__: __main__; __doc__: None; __package__: None; __loader__: ... As an example, the following lines produce a tidily aligned set of columns giving integers and their squ...
- 7. Simple statements
...ve_module ::= "."* module | "."+ The basic import statement (no from clause) is executed in two steps: find a module, loading and initializing it if necessary define a name or names in the local namespace for the scope where the import st...
- 7. Using Python on iOS
.... This conflicts with the usual Python approach for distributing binaries, which allows a binary extension module to be loaded from any location on sys.path. To ensure compliance with App Store policies, an iOS project must post-process any...
- 8. Compound statements
...(the expression given in the with_item) is evaluated to obtain a context manager. The context manager’s __enter__() is loaded for later use. The context manager’s __exit__() is loaded for later use. The context manager’s __enter__() method...
- Audit events table
...ta [1] import module, filename, sys.path, sys.meta_path, sys.path_hooks [1] marshal.dumps value, version [1] marshal.load [1] marshal.loads bytes [1] mmap.__new__ fileno, length, access, offset [1] msvcrt.get_osfhandle fd [1] msvcrt...
- Built-in Exceptions
...since it is technically not an error. exception ImportError Raised when the import statement has troubles trying to load a module. Also raised when the “from list” in from ... import has a name that cannot be found. The optional name a...
- Built-in Functions
...in the struct module ['Struct', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__initializing__', '__loader__', '__name__', '__package__', '_clearcache', 'calcsize', 'error', 'pack', 'pack_into', 'unpack', 'unpack_from'...
- Built-in Types
..._ directly is not recommended. Modules built into the interpreter are written like this: <module 'sys' (built-in)>. If loaded from a file, they are written as <module 'os' from '/usr/local/lib/pythonX.Y/os.pyc'>. Classes and Class Instan...
- C API Stability
...duced the Limited API, a subset of Python’s C API. Extensions that only use the Limited API can be compiled once and be loaded on multiple versions of Python. Contents of the Limited API are listed below. Py_LIMITED_API Define this macro...
- Capsules
...module available to other modules, so the regular import mechanism can be used to access C APIs defined in dynamically loaded modules. type PyCapsule_Destructor Part of the Stable ABI.The type of a destructor callback for a capsule....
- Changelog
...troduced in gh-85160. gh-129583: Update bundled pip to 25.0.1 gh-97850: Update the deprecation warning of importlib.abc.Loader.load_module(). gh-129646: Update the locale alias mapping in the locale module to match the latest X Org locale a...
- Codec registry and support functions
...(PyObject *search_function) Part of the Stable ABI.Register a new codec search function. As side effect, this tries to load the encodings package, if not yet done, to make sure that it is always first in the list of search functions. i...
- Common Object Structures
...r to what is created when using the staticmethod() built-in function. One other constant controls whether a method is loaded in place of another definition with the same method name. METH_COEXIST The method will be loaded in place of ex...
- Data marshalling support
...ObjectFromFile(), this function assumes that no further objects will be read from the file, allowing it to aggressively load file data into memory so that the de-serialization can operate from data in memory rather than reading a byte at a...
- Debugging C API extensions and CPython Internals with GDB
...t directory of your repository. To activate support, you must add the directory containing python-gdb.py to GDB’s “auto-load-safe-path”. If you haven’t done this, recent versions of GDB will print out a warning with instructions on how to d...
- Descriptor Guide
...es = ['x', 'y'] def __init__(self, x, y): self.x = x self.y = y At this point, the metaclass has loaded member objects for x and y: >>> from pprint import pp >>> pp(dict(vars(H))) {'__module__': '__main__', '__doc__'...
- Development Tools
...sts and expected failures Distinguishing test iterations using subtests Classes and functions Test cases Grouping tests Loading and running tests load_tests Protocol Class and Module Fixtures setUpClass and tearDownClass setUpModule and...
- Enum HOWTO
...num was explicitly designed to behave differently, see below): >>> Color.BLUE == 2 False Warning It is possible to reload modules – if a reloaded module contains enums, they will be recreated, and the new members may not compare identica...
- Extending and Embedding the Python Interpreter
...ion, for use as an extension language. Finally, it shows how to compile and link extension modules so that they can be loaded dynamically (at run time) into the interpreter, if the underlying operating system supports this feature. This do...
- Extending/Embedding FAQ
...bug is so minor that it doesn’t seem worth the effort.) How do I debug an extension? When using GDB with dynamically loaded extensions, you can’t set a breakpoint in your extension until your extension is loaded. In your .gdbinit file (o...
- Generic Operating System Services
...Android Platform errno — Standard errno system symbols ctypes — A foreign function library for Python ctypes tutorial Loading dynamic link libraries Accessing functions from loaded dlls Calling functions Fundamental data types Calling fun...
- Glossary
...ctures (in the collections.abc module), numbers (in the numbers module), streams (in the io module), import finders and loaders (in the importlib.abc module). You can create your own ABCs with the abc module. annotationA label associated...
- Graphical User Interfaces with Tk
...kinter Dialogs tkinter.simpledialog — Standard Tkinter input dialogs tkinter.filedialog — File selection dialogs Native Load/Save Dialogs tkinter.commondialog — Dialog window templates tkinter.messagebox — Tkinter message prompts tkinte...
- HOWTO Fetch Internet Resources Using The urllib Package
...pen(req) as response: the_page = response.read() Note that other encodings are sometimes required (e.g. for file upload from HTML forms - see HTML Specification, Form Submission for more details). If you do not pass the data argument,...
- IDLE — Python editor and shell
...used frequently from the IDLE shell, or for executing import statements to import common modules. In addition, Tk also loads a startup file if it is present. Note that the Tk file is loaded unconditionally. This additional file is .Idle....
- Importing Modules
...rt hooks are installed in the current environment. This function always uses absolute imports. PyObject *PyImport_ReloadModule(PyObject *m) Return value: New reference. Part of the Stable ABI.Reload a module. Return a new reference to...
- Initialization, Finalization, and Threads
...on. Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. If greater or equal to 2, print a message for each file that is checked for when searching for a module. Also p...
- Instrumenting CPython with DTrace and SystemTap
...the Python interpreter finishes a garbage collection cycle. arg0 is the number of collected objects. import__find__load__start(str modulename) Fires before importlib attempts to find and load the module. arg0 is the module name. Added...
- Introduction
...e interpreter has been initialized. The basic initialization function is Py_Initialize(). This initializes the table of loaded modules, and creates the fundamental modules builtins, __main__, and sys. It also initializes the module search...
- Isolating Extension Modules
...nless the extension developer is careful, it is very easy to introduce edge cases that lead to crashes when a module is loaded in more than one interpreter in the same process. Unfortunately, per-interpreter state is not easy to achieve. Ex...
- Library and Extension FAQ
...ocket.py, regex.py, etc.) source file? If you can’t find a source file for a module it may be a built-in or dynamically loaded module implemented in C, C++ or other compiled language. In this case you may not have the source file or it may...
- Logging Cookbook
...vel) def filter(record): return record.levelno <= level return filter logging.config.dictConfig(json.loads(CONFIG)) logging.debug('A DEBUG message') logging.info('An INFO message') logging.warning('A WARNING message') log...
- Logging HOWTO
...INFO 20 DEBUG 10 NOTSET 0 Levels can also be associated with loggers, being set either by the developer or through loading a saved logging configuration. When a logging method is called on a logger, the logger compares its own level wi...
- Module Objects
...sion 3.7.Return a new module object with module.__name__ set to name. The module’s __name__, __doc__, __package__ and __loader__ attributes are filled in (all but __name__ are set to None). The caller is responsible for setting a __file__ a...
- Operating System Utilities
...rk; this should be called in the new process if the Python interpreter will continue to be used. If a new executable is loaded into the new process, this function does not need to be called. Deprecated since version 3.7: This function is s...
- Programming FAQ
...e to make it easier to change the base class? How do I create static class data and static class methods? How can I overload constructors (or methods) in Python? I try to use __spam and I get an error about _SomeClassName__spam. My class de...
- Python Documentation contents
...should I write my code to utilize these speedups? Will CPython 3.11 use more memory? I don’t see any speedups in my workload. Why? Is there a JIT compiler? About CPython bytecode changes New opcodes Replaced opcodes Changed/removed opco...
- Python Initialization Configuration
...han 0, print a message each time a module is imported, showing the place (filename or built-in module) from which it is loaded. If greater than or equal to 2, print a message for each file that is checked for when searching for a module. Al...
- Python on Windows FAQ
...System. NN is the Python version, a number such as “33” for Python 3.3. You can link to Python in two different ways. Load-time linking means linking against pythonNN.lib, while run-time linking means linking against pythonNN.dll. (Gener...
- Socket Programming HOWTO
...or not), you may not get all 5 characters in one recv. In playing around, you’ll get away with it; but in high network loads, your code will very quickly break unless you use two recv loops - the first to determine the length, the second t...
- The initialization of the
sys.path
module search path.... On Windows prefix and exec_prefix are the same, however on other platforms lib/pythonmajorversion.minorversion/lib-dynload (lib/python3.11/lib-dynload) is searched for and used as an anchor for exec_prefix. On some platforms lib may be li...
- The Python Language Reference
...program 4.2. Naming and binding 4.3. Exceptions 5. The import system 5.1. importlib 5.2. Packages 5.3. Searching 5.4. Loading 5.5. The Path Based Finder 5.6. Replacing the standard import system 5.7. Package Relative Imports 5.8. Special...
- The Python Profilers
...ation, the object is considered to have its entries in a “random” order, as it was just after object initialization and loading. If strip_dirs() causes two function names to be indistinguishable (they are on the same line of the same filena...
- What’s New in Python 2.0
...rge.net/ for more information. Another new platform is Darwin/MacOS X; initial support for it is in Python 2.0. Dynamic loading works, if you specify “configure –with-dyld –with-suffix=.x”. Consult the README in the Python source distributi...
- What’s New in Python 2.2
...eaning of / will not change until Python 3.0. Classes can define methods called __truediv__() and __floordiv__() to overload the two division operators. At the C level, there are also slots in the PyNumberMethods structure so extension typ...
- What’s New in Python 2.3
...me, path=None). fullname will be a module or package name, e.g. string or distutils.core. find_module() must return a loader object that has a single method, load_module(fullname), that creates and returns the corresponding module object....
- What’s New in Python 2.5
...e sdist command, the dependency information will be recorded in the PKG-INFO file. Another new keyword parameter is download_url, which should be set to a URL for the package’s source code. This means it’s now possible to look up an entry...
- What’s New in Python 2.6
...orgThe Python bug tracker. https://bugs.jython.org:The Jython bug tracker. https://roundup.sourceforge.io/Roundup downloads and documentation. https://svn.python.org/view/tracker/importer/Martin von Löwis’s conversion scripts. New D...
- What’s New in Python 2.7
...and libraries that can make it easier to migrate to Python 3. The Python Packaging User Guide provides guidance on downloading and installing software from the Python Package Index. While the preferred approach to enhancing Python 2 is now...
- What’s New In Python 3.0
...s to use sys.exc_info() (though the latter is not removed). A few exception messages are improved when Windows fails to load an extension module. For example, error code 193 is now %1 is not a valid Win32 application. Strings now deal wit...
- What’s New In Python 3.1
...package name is supplied. (Contributed by Andi Vajda; bpo-4195.) The pdb module can now access and display source code loaded via zipimport (or any other conformant PEP 302 loader). (Contributed by Alexander Belopolsky; bpo-4201.) functoo...
- What’s New In Python 3.10
...mon bug. For example: # BUG: "rb" mode or encoding="utf-8" should be used. with open("data.json") as f: data = json.load(f) To find this type of bug, an optional EncodingWarning is added. It is emitted when sys.flags.warn_default_enco...
- What’s New In Python 3.11
...sets the __final__ attributed on the decorated object. (Contributed by Jelle Zijlstra in gh-90500.) The typing.get_overloads() function can be used for introspecting the overloads of a function. typing.clear_overloads() can be used to clea...
- What’s New In Python 3.12
- What’s New In Python 3.13
...field is omitted, that field will now be set to an empty list, and if an expr_context field is omitted, it defaults to Load(). (Previously, in all cases, the attribute would be missing on the newly constructed AST node instance.) In all ot...
- What’s New In Python 3.2
...UG", "handlers": ["console", "console_priority"]}} If that dictionary is stored in a file called conf.json, it can be loaded and called with code like this: >>> import json, logging.config >>> with open('conf.json') as f: ... conf = j...
- What’s New In Python 3.3
...t__ bpo-13959 - Re-implement parts of imp in pure Python bpo-14605 - Make import machinery explicit bpo-14646 - Require loaders set __loader__ and __package__ The __import__() function is now powered by importlib.__import__(). This work lea...
- What’s New In Python 3.4
...fication, including hostname matching (ssl.match_hostname()) and CRLs (Certificate Revocation lists, see ssl.SSLContext.load_verify_locations()). CPython implementation improvements: Safe object finalization (PEP 442). Leveraging PEP 442,...
- What’s New In Python 3.5
...Builtin and extension modules are now initialized in a multi-phase process, which is similar to how Python modules are loaded. (See PEP 489 overview.) Significant improvements in the standard library: collections.OrderedDict is now imple...
- What’s New In Python 3.6
...ent checks for ImportError (in try-except) will still work. (Contributed by Eric Snow in bpo-15767.) importlib.util.LazyLoader now calls create_module() on the wrapped loader, removing the restriction that importlib.machinery.BuiltinImporte...
- What’s New In Python 3.7
...on modules is now also allowed. A typical example of where this may be useful is module attribute deprecation and lazy loading. See also PEP 562 – Module __getattr__ and __dir__PEP written and implemented by Ivan Levkivskyi PEP 564:...
- What’s New In Python 3.8
...ame ABI whether it’s built in release or debug mode. On Unix, when Python is built in debug mode, it is now possible to load C extensions built in release mode and C extensions built using the stable ABI. Release builds and debug builds are...
- What’s New In Python 3.9
...time methods now returns a namedtuple() instead of a tuple. (Contributed by Donghee Na in bpo-24416.) distutils The upload command now creates SHA2-256 and Blake2b-256 hash digests. It skips MD5 on platforms that block MD5 digest. (Contri...