Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
...abs(time.time_ns() - time.time_ns()) for _ in range(LOOPS)] min_dt = min(filter(bool, min_dt)) print("min time_ns() delta: %s ns" % min_dt) min_dt = [abs(time.time() - time.time()) for _ in range(LOOPS)] min_dt = min(filter(bool, min_dt)) print("min time() delta: %s ns" % math.ceil(min_dt * 1e9)) Linux Clocks resolution measured in Python on Fedora 26 (kernel 4.12): Function Resolution clock() 1 us monotonic() 81 ns monotonic_ns() 84 ns perf_counter() 82 ns p...
...absolute requirement -- the new class type could return an object of some existing type when invoked to create an instance.) Still confused? Here's a simple device due to Don himself to explain metaclasses. Take a simple class definition; assume B is a special class that triggers Don's hook: class C(B): a = 1 b = 2 This can be though of as equivalent to: C = type(B)('C', (B,), {'a': 1, 'b': 2}) If that's too dense for you, here's the same thing written out ...
...Abstract Motivation and Rationale Core Semantics Core behavior Equivalence of two Literals Shortening unions of literals Legal and illegal parameterizations Legal parameters for Literal at type check time Illegal parameters for Literal at type check time Parameters at runtime Literals, enums, and forward references Type inference Backwards compatibility Using non-Literals in Literal contexts Interactions with other types and features Intelligent indexing of structured data Interactions wit...
...Abstract PEP Withdrawal Rationale Mirror listing and registering Statistics page Mirror Authenticity Special pages a mirror needs to provide Last modified date Local statistics How a mirror should synchronize with PyPI The mirroring protocol User-agent request header How a client can use PyPI and its mirrors Fail-over mechanism Extra package indexes Merging several indexes References Acknowledgments Copyright Abstract This PEP describes a mirroring infrastructure for PyPI. PEP Withdra...
...abs AB. Fredrik's article about the award O'Reilly press release Fredrik's homepage Andrew Kuchling (2002) Andrew is a prolific programmer and the author of many articles, including the extensive "What's New in Python" series, published for each version of Python since 2.0. Since receiving the Frank Willison Award, Andrew has served on the PSF Board of Directors and he co-chaired the 2006 & 2007 PyCon community conferences in Dallas, Texas. Andrew is now operating a consulti...
...Abstract Description Additional Ideas FAQs Graphics Comparison Copyright Deferral While this PEP is a nice idea, no-one has yet emerged to do the work of hashing out the differences between this PEP, PEP 266 and PEP 267. Hence, it is being deferred. Abstract This PEP describes yet another approach to optimizing access to module globals, providing an alternative to PEP 266 (Optimizing Global Variable/Attribute Access by Skip Montanaro) and PEP 267 (Optimized Access to Module Namespaces by Je...
...absolute ftp paths in urllib2. Patch 711838: Support non-anonymous ftp URLs in urllib2. Windows The Windows installer now includes tix, the Tk Interface eXtension, a powerful set of user interface components that expands the capabilities of your Tcl/Tk and Python applications. Build Bug #929689: Don't define _XOPEN_SOURCE on UnixWare 7.1.4. What's New in Python 2.3.3 (final)? Release date: 19-Dec-2003 Core and builtins Removed PendingDeprecationWarning from apply(). apply() rem...
...Abstract:This document is intended for Python programmers who want to understand the C3 Method Resolution Order used in Python 2.3. Although it is not intended for newbies, it is quite pedagogical with many worked out examples. I am not aware of other publicly available documents with the same scope, therefore it should be useful. Disclaimer: I donate this document to the Python Software Foundation, under the Python 2.3 license. As usual in these circumstances, I warn the reader that what ...
PEP 410 -- Use decimal.Decimal type for timestamps PEP:410 Title:Use decimal.Decimal type for timestamps Author:Victor Stinner <vstinner at python.org> Status:Rejected Type:Standards Track Created:01-Feb-2012 Python-Version:3.3 Resolution:https://mail.python.org/pipermail/python-dev/2012-February/116837.html Contents Rejection Notice Abstract Rationale Specification Backwards Compatibility Objection: clocks accuracy Alternatives: Timestamp types Number of nanoseconds (in...
PEP 450 -- Adding A Statistics Module To The Standard Library PEP:450 Title:Adding A Statistics Module To The Standard Library Author:Steven D'Aprano <steve at pearwood.info> Status:Final Type:Standards Track Created:01-Aug-2013 Python-Version:3.4 Post-History:13-Sep-2013 Contents Abstract Rationale Comparison To Other Languages/Packages R C# Ruby PHP Delphi GNU Scientific Library Design Decisions Of The Module API Calculating mean, median and mode Calculating variance...
PEP 498 -- Literal String Interpolation PEP:498 Title:Literal String Interpolation Author:Eric V. Smith <eric at trueblade.com> Status:Final Type:Standards Track Created:01-Aug-2015 Python-Version:3.6 Post-History:07-Aug-2015, 30-Aug-2015, 04-Sep-2015, 19-Sep-2015, 06-Nov-2016 Resolution:https://mail.python.org/pipermail/python-dev/2015-September/141526.html Contents Abstract Rationale No use of globals() or locals() Specification Escape sequences Code equivalence Exp...
...absolute reason to favor one or the other. It is easy to cast from one representation to another in a sizable chunk of code, so the other flavor of operators is always minority. There are other semantic differences that favor existence of array-oriented and matrix-oriented packages, even if their operators are unified. Whatever the decision is taken, codes using existing interfaces should not be broken for a very long time. Therefore, not much is lost, and much flexibility retained, if the sema...
...absolute pathname after interpretation of symbolic links. On non-Unix systems, this is an alias for os.path.abspath(). operator.indexOf() (PySequence_Index() in the C API) now works with any iterable object. smtplib now supports various authentication and security features of the SMTP protocol through the new login() and starttls() methods. hmac: a new module implementing keyed hashing for message authentication. mimetypes now recognizes more extensions and file types. At the same time, some m...
...abs AB is working on a Unicode-aware regular expression machinery. It works on plain 8-bit, UCS-2, and (optionally) UCS-4 internal character buffers. Also see http://www.unicode.org/unicode/reports/tr18/ for some remarks on how to treat Unicode REs. Formatting Markers Format markers are used in Python format strings. If Python strings are used as format strings, the following interpretations should be in effect: '%s': For Unicode objects this will cause coercion of the whole format s...
...Abstract Patterns and shapes Syntax Motivation Overview Pattern, a new syntactic construct, and destructuring Matching process Rationale and Goals Syntax and Semantics Patterns The match statement Match semantics Allowed patterns Literal Patterns Capture Patterns Wildcard Pattern Constant Value Patterns Sequence Patterns Mapping Patterns Class Patterns Combining multiple patterns (OR patterns) Guards Walrus patterns Runtime specification The Match Protocol Overlapping sub-patterns Specia...
...Abstract Motivation Pattern Matching and OO Patterns and Functional Style Rationale Overview and Terminology The Match Statement Match Semantics Guards Patterns AS Patterns OR Patterns Literal Patterns Capture Patterns Wildcard Pattern Value Patterns Group Patterns Sequence Patterns Mapping Patterns Class Patterns History and Context Backwards Compatibility Security Implications Reference Implementation References Copyright Abstract This PEP provides the motivation and rationale for P...
...Abstract Acceptance Motivation Summary Examples Specification Type Variable Tuples Using Type Variable Tuples in Generic Classes Using Type Variable Tuples in Functions Type Variable Tuples Must Always be Unpacked Unpack for Backwards Compatibility Variance, Type Constraints and Type Bounds: Not (Yet) Supported Type Variable Tuple Equality Multiple Type Variable Tuples: Not Allowed Type Concatenation Unpacking Tuple Types Unpacking Concrete Tuple Types Unpacking Unbounded Tuple Types Multiple ...