Perhaps one of the most important structures of the Python object system is the structure that defines a new type: the PyTypeObject structure. Type objects can be handled using any of the PyObject_...| Python documentation
Source code: Lib/fileinput.py This module implements a helper class and functions to quickly write a loop over standard input or a list of files. If you just want to read or write one file see open...| Python documentation
Interactive Mode: There are two variants of the interactive REPL. The classic basic interpreter is supported on all platforms with minimal line control capabilities. On Windows, or Unix-like system...| Python documentation
The web framework for perfectionists with deadlines.| Django Project
Source code: Lib/pkgutil.py This module provides utilities for the import system, in particular package support.| Python documentation
The web framework for perfectionists with deadlines.| Django Project
In Python, all exceptions must be instances of a class that derives from BaseException. In a try statement with an except clause that mentions a particular class, that clause also handles any excep...| Python documentation
Source code: Lib/bisect.py This module provides support for maintaining a list in sorted order without having to sort the list after each insertion. For long lists of items with expensive compariso...| Python documentation
Source code: Lib/weakref.py The weakref module allows the Python programmer to create weak references to objects. In the following, the term referent means the object which is referred to by a weak...| Python documentation
Source code: Lib/http/client.py This module defines classes that implement the client side of the HTTP and HTTPS protocols. It is normally not used directly — the module urllib.request uses it to h...| Python documentation
Source code: Lib/zipfile/ The ZIP file format is a common archive and compression standard. This module provides tools to create, read, write, append, and list a ZIP file. Any advanced use of this ...| Python documentation
An explanation of all of Python's 100+ dunder methods and 50+ dunder attributes, including a summary of each one.| www.pythonmorsels.com
Represents a client connection that connects to Discord.| discordpy.readthedocs.io
Add a handler sending log messages to a sink adequately configured.| loguru.readthedocs.io
In this tutorial, you'll learn what magic methods are in Python, how they work, and how to use them in your custom classes to support powerful features in your object-oriented code.| realpython.com
Usage| import-linter.readthedocs.io
Source code: Lib/mailbox.py This module defines two classes, Mailbox and Message, for accessing and manipulating on-disk mailboxes and the messages they contain. Mailbox offers a dictionary-like ma...| Python documentation
Creating Heap-Allocated Types: The following functions and structs are used to create heap types.| Python documentation
The functions and macros in this section are used for managing reference counts of Python objects.| Python documentation
The web framework for perfectionists with deadlines.| Django Project
The web framework for perfectionists with deadlines.| Django Project
In this tutorial, you'll learn how to use the Python standard REPL (Read-Eval-Print Loop) to run your code interactively. This tool will allow you to test new ideas, explore and experiment with new tools and libraries, refactor and debug your code, try out examples, and more.| realpython.com
In Python, a tuple is a built-in data type that allows you to create immutable sequences of values. The values or items in a tuple can be of any type. This makes tuples pretty useful in those situations where you need to store heterogeneous data, like that in a database record, for example.| realpython.com
In this tutorial, you'll dive deep into Python's lists. You'll learn how to create them, update their content, populate and grow them, and more. Along the way, you'll code practical examples that will help you strengthen your skills with this fundamental data type in Python.| realpython.com
In this tutorial, you'll learn what iterators and iterables are in Python. You'll learn how they differ and when to use them in your code. You'll also learn how to create your own iterators and iterables to make data processing more efficient.| realpython.com
The web framework for perfectionists with deadlines.| Django Project
PyGILState_Ensure(), PyGILState_Release(), and other related functions in the PyGILState family are the most common way to create native threads that interact with Python. They have been the standard for over twenty years (PEP 311). But, over time, thes...| Python Enhancement Proposals (PEPs)
...in which we build a hybrid concurrent.futures executor that runs I/O bound tasks on all available CPUs, thus evading the limitations imposed by the dreaded global interpreter lock on the humble ThreadPoolExecutor.| death and gravity
This module provides an interface to the optional garbage collector. It provides the ability to disable the collector, tune the collection frequency, and set debugging options. It also provides acc...| Python documentation
Source code: Lib/email/parser.py Message object structures can be created in one of two ways: they can be created from whole cloth by creating an EmailMessage object, adding headers using the dicti...| Python documentation
Source code: Lib/email/generator.py One of the most common tasks is to generate the flat (serialized) version of the email message represented by a message object structure. You will need to do thi...| Python documentation
The web framework for perfectionists with deadlines.| Django Project
Build Requirements: Features and minimum versions required to build CPython: A C11 compiler. Optional C11 features are not required., On Windows, Microsoft Visual Studio 2017 or later is required.,...| Python documentation
Free-threaded Python (PEP-703) was released in October 2024. It enables true multi-threaded execution without the restriction of the GIL. I...| blog.changs.co.uk
Bag¶| docs.dask.org
Source code: Lib/configparser.py This module provides the ConfigParser class which implements a basic configuration language which provides a structure similar to what’s found in Microsoft Windows ...| Python documentation
What is an API?: API stands for A pplied P rogramming I nterface. When discussed in the context of a (Python) package, the API refers to the functions, classes, methods, and attributes that a packa...| pyOpenSci Python Package Guide
I would simply use delimiter characters to delimit data.| Matt Hodges
This section outlines high-level asyncio APIs to work with coroutines and Tasks. Coroutines, Awaitables, Creating Tasks, Task Cancellation, Task Groups, Sleeping, Running Tasks Concurrently, Eager ...| Python documentation
Bases: _Tabular| arrow.apache.org
Source code: Lib/tarfile.py The tarfile module makes it possible to read and write tar archives, including those using gzip, bz2 and lzma compression. Use the zipfile module to read or write.zip fi...| Python documentation
Source code: Lib/importlib/__init__.py Introduction: The purpose of the importlib package is three-fold. One is to provide the implementation of the import statement (and thus, by extension, the__i...| Python documentation
Source code: Lib/glob.py The glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell, although results are returned in arbitrary order. No til...| Python documentation
Source code: Lib/zipapp.py This module provides tools to manage the creation of zip files containing Python code, which can be executed directly by the Python interpreter. The module provides both ...| Python documentation
These functions are useful when creating your own extension functions and methods. Additional information and examples are available in Extending and Embedding the Python Interpreter. The first thr...| Python documentation
In this tutorial, you'll learn about duck typing in Python. It's a typing system based on objects' behaviors rather than on inheritance. By taking advantage of duck typing, you can create flexible and decoupled sets of Python classes that you can use together or individually.| realpython.com
Source code: Lib/urllib/request.py The urllib.request module defines functions and classes which help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirection...| Python documentation
System Functions: These are utility functions that make functionality from the sys module accessible to C code. They all work with the current interpreter thread’s sys module’s dict, which is conta...| Python documentation
Python can be initialized with Py_InitializeFromConfig() and the PyConfig structure. It can be preinitialized with Py_PreInitialize() and the PyPreConfig structure. There are two kinds of configura...| Python documentation
Source code: Lib/random.py This module implements pseudo-random number generators for various distributions. For integers, there is uniform selection from a range. For sequences, there is uniform s...| Python documentation
Source code: Lib/asyncio/futures.py, Lib/asyncio/base_futures.py Future objects are used to bridge low-level callback-based code with high-level async/await code. Future Functions: Future Object: T...| Python documentation
Source code: Lib/secrets.py The secrets module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, ...| Python documentation
The web framework for perfectionists with deadlines.| Django Project
Source code: Lib/asyncio/runners.py This section outlines high-level asyncio primitives to run asyncio code. They are built on top of an event loop with the aim to simplify async code usage for com...| Python documentation
Source code: Lib/inspect.py The inspect module provides several useful functions to help get information about live objects such as modules, classes, methods, functions, tracebacks, frame objects, ...| Python documentation
Decorators versus blocks and partial functions.| coady.github.io
Contrarian view on composition over inheritance.| coady.github.io
Source code: Lib/genericpath.py, Lib/posixpath.py(for POSIX) and Lib/ntpath.py(for Windows). This module implements some useful functions on pathnames. To read or write files see open(), and for ac...| Python documentation
Source code: Lib/io.py Overview: The io module provides Python’s main facilities for dealing with various types of I/O. There are three main types of I/O: text I/O, binary I/O and raw I/O. These ar...| Python documentation
Source code: Lib/csv.py The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to att...| Python documentation
Source code: Lib/fnmatch.py This module provides support for Unix shell-style wildcards, which are not the same as regular expressions (which are documented in the re module). The special character...| Python documentation
Source code: Lib/zoneinfo The zoneinfo module provides a concrete time zone implementation to support the IANA time zone database as originally specified in PEP 615. By default, zoneinfo uses the s...| Python documentation
Source code: Lib/ctypes ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these ...| Python documentation
Source code: Lib/site.py This module is automatically imported during initialization. The automatic import can be suppressed using the interpreter’s-S option. Importing this module normally appends...| Python documentation
Meltano provides a command line interface (CLI) that makes it easy to manage your project, plugins, and EL(T) pipelines.| docs.meltano.com
Source code: Lib/enum.py Important: This page contains the API reference information. For tutorial information and discussion of more advanced topics, see Basic Tutorial, Advanced Tutorial, Enum Co...| Python documentation
Source code: Lib/fractions.py The fractions module provides support for rational number arithmetic. A Fraction instance can be constructed from a pair of integers, from another rational number, or ...| Python documentation
Source code: Lib/codecs.py This module defines base classes for standard Python codecs (encoders and decoders) and provides access to the internal Python codec registry, which manages the codec and...| Python documentation
Source code: Lib/argparse.py Tutorial: This page contains the API reference information. For a more gentle introduction to Python command-line parsing, have a look at the argparse tutorial. The arg...| Python documentation
Certain objects available in Python wrap access to an underlying memory array or buffer. Such objects include the built-in bytes and bytearray, and some extension types like array.array. Third-part...| Python documentation
Introduction: Python applications will often use packages and modules that don’t come as part of the standard library. Applications will sometimes need a specific version of a library, because the ...| Python documentation
Editors, Elvis Pranskevichus < elvis@magic.io>, Yury Selivanov < yury@magic.io>,. This article explains the new features in Python 3.6, compared to 3.5. Python 3.6 was released on December 23, 2016...| Python documentation
Source code: Lib/dataclasses.py This module provides a decorator and functions for automatically adding generated special methods such as__init__() and__repr__() to user-defined classes. It was ori...| Python documentation
Source code: Lib/timeit.py This module provides a simple way to time small bits of Python code. It has both a Command-Line Interface as well as a callable one. It avoids a number of common traps fo...| Python documentation
Source code: Lib/heapq.py This module provides an implementation of the heap queue algorithm, also known as the priority queue algorithm. Heaps are binary trees for which every parent node has a va...| Python documentation
Editor, Adam Turner,. This article explains the new features in Python 3.12, compared to 3.11. Python 3.12 was released on October 2, 2023. For full details, see the changelog. Summary – Release hi...| Python documentation
Source code: Lib/contextlib.py This module provides utilities for common tasks involving the with statement. For more information see also Context Manager Types and With Statement Context Managers....| Python documentation
Source code: Lib/collections/__init__.py This module implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers, dict, list, set, and tuple.,,...| Python documentation
As well as the while statement just introduced, Python uses a few more that we will encounter in this chapter. if Statements: Perhaps the most well-known statement type is the if statement. For exa...| Python documentation
Is most of your runtime spent waiting on responses from remote nodes? Let's talk concurrency.| Snake Charmers
Author, Raymond Hettinger,, Contact,,. Contents: Descriptor Guide- Primer- Simple example: A descriptor that returns a constant, Dynamic lookups, Managed attributes, Customiz...| Python documentation
Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax an...| Python documentation
Author, Andrew Dalke and Raymond Hettinger,. Python lists have a built-in list.sort() method that modifies the list in-place. There is also a sorted() built-in function that builds a new sorted lis...| Python documentation
Graphing TLA+ state spaces for fun and profit.| Hillel Wayne
Source code: Lib/pathlib/ This module offers classes representing filesystem paths with semantics appropriate for different operating systems. Path classes are divided between pure paths, which pro...| Python documentation
This module provides various time-related functions. For related functionality, see also the datetime and calendar modules. Although this module is always available, not all functions are available...| Python documentation
A simple statement is comprised within a single logical line. Several simple statements may occur on a single line separated by semicolons. The syntax for simple statements is: Expression statement...| Python documentation
See Python Initialization Configuration for details on how to configure the interpreter prior to initialization. Before Python Initialization: In an application embedding Python, the Py_Initialize(...| Python documentation
Source code: Lib/unittest/__init__.py(If you are already familiar with the basic concepts of testing, you might want to skip to the list of assert methods.) The unittest unit testing framework was ...| Python documentation
Definitions for colloquial Python terminology (effectively an unofficial version of the Python glossary).| www.pythonmorsels.com
Editor, Pablo Galindo Salgado,. This article explains the new features in Python 3.11, compared to 3.10. Python 3.11 was released on October 24, 2022. For full details, see the changelog. Summary –...| Python documentation
Most Python programmers don’t spend a lot of time thinking about how equality and hashing works. It usually just works. However there’s quite a bit of gotchas and edge cases that can lead to subtle and frustrating bugs once one starts to customize their behavior – especially if the rules on how they interact aren’t understood.| Hynek Schlawack
namedtuple has been around since forever, and over time, its convenience saw it used far outside its originally intended purpose. With dataclasses now covering part of those use cases, what should one use named tuples for? In this article, I address this question, and give a few examples from real code.| death and gravity
In this article, you'll find out what Python hashlib "object supporting the buffer API required" TypeErrors mean, why do they happen, and what you can do about it.| death and gravity
Back in 2007 Python added Abstract Base Classes, which were intended to be used as interfaces: from abc import ABC class AbstractIterable(ABC): @abstractmethod def __iter__(self): while False: yield None def get_iterator(self): return self.__iter__() ABCs were added to strengthen the duck typing a little. If you inherited AbstractIterable, then everybody knew you had an implemented __iter__ method, and could handle that appropriately. Unsurprisingly, this idea never caught on. People instead ...| Hillel Wayne
Comparing things in Python. That sounds like something that almost doesn’t even need to be taught. But I’ve found that Python’s …| treyhunner.com
A critical but informative look at the new structural pattern matching feature in Python 3.10, with real-world code examples.| benhoyt.com