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.
...PEP 310 and rearrange the lot into an elegant whole. It borrows from various other PEPs in order to paint a complete picture, and is intended to stand on its own. Author's Note During the discussion of PEP 340, I maintained drafts of this PEP as PEP 3XX on my own website (since I didn't have CVS access to update a submitted PEP fast enough to track the activity on python-dev). Since the first draft of this PEP, Guido wrote PEP 343 as a simplified version of PEP 340. PEP 343 (at the time of w...
...PEP 428, a "pathlib" module providing object-oriented filesystem paths PEP 435, a standardized "enum" module PEP 436, a build enhancement that will help generate introspection information for builtins PEP 442, improved semantics for object finalization PEP 443, adding single-dispatch generic functions to the standard library PEP 445, a new C API for implementing custom memory allocators PEP 446, changing file descriptors to not be inherited by default in subprocesses PEP 450,...
...PEP proposes to enhance generators by providing mechanisms for raising exceptions and sharing data with running generators. Status This PEP is withdrawn. The exception raising mechanism was extended and subsumed into PEP 343. The attribute passing capability never built a following, did not have a clear implementation, and did not have a clean way for the running generator to access its own namespace. Rationale Currently, only class based iterators can provide attributes and exception hand...
...PEP and in the associated documentation and implementation [14]. The PEP stabilised around the time of the first Python 2.5 beta release. Yes, the verb tense is messed up in a few places. We've been working on this PEP for over a year now, so things that were originally in the future are now in the past :) Introduction After a lot of discussion about PEP 340 and alternatives, I decided to withdraw PEP 340 and proposed a slight variant on PEP 310. After more discussion, I have added back a mec...
...PEP 308: Conditional Expressions PEP 309: Partial Function Application PEP 314: Metadata for Python Software Packages v1.1 PEP 328: Absolute/Relative Imports PEP 338: Executing Modules as Scripts PEP 341: Unified try-except/try-finally to try-except-finally PEP 342: Coroutines via Enhanced Generators PEP 343: The "with" Statement (still need updates in Doc/ref and for the contextlib module) PEP 352: Required Superclass for Exceptions PEP 353: Using ssize_t as the index type PEP 357: Allowing Any...
...PEP proposes a piece of syntax (a 'with' block) and a "small-i" interface that generalizes the above. Pronouncement This PEP is rejected in favor of PEP 343. Rationale One of the advantages of Python's exception handling philosophy is that it makes it harder to do the "wrong" thing (e.g. failing to check the return value of some system call). Currently, this does not apply to resource cleanup. The current syntax for acquisition and release of a resource (for example, a lock) is: the_lock....
PEP 377 -- Allow __enter__() methods to skip the statement body PEP:377 Title:Allow __enter__() methods to skip the statement body Author:Nick Coghlan <ncoghlan at gmail.com> Status:Rejected Type:Standards Track Created:08-Mar-2009 Python-Version:2.7, 3.1 Post-History:08-Mar-2009 Contents Abstract PEP Rejection Proposed Change Rationale for Change Performance Impact Reference Implementation Acknowledgements References Copyright Abstract This PEP proposes a backwards c...
...PEPs, which may be considered redundant if this PEP is accepted: PEP 288, Generators Attributes and Exceptions. The current PEP covers its second half, generator exceptions (in fact the throw() method name was taken from PEP 288). PEP 342 replaces generator attributes, however, with a concept from an earlier revision of PEP 288, the yield expression. PEP 325, Resource-Release Support for Generators. PEP 342 ties up a few loose ends in the PEP 325 spec, to make it suitable for actual implemen...
...PEP 310 Reliable Acquisition/Release Pairs How Java Does It How Jython Does It Summary of Proposed Changes to Python Risks Dissenting Opinion References Copyright Abstract This PEP proposes adding two new keywords to Python, 'synchronize' and 'asynchronize'. Pronouncement This PEP is rejected in favor of PEP 343. The 'synchronize' Keyword The concept of code synchronization in Python is too low-level. To synchronize code a programmer must be aware of the details of the following pseudo-cod...
...PEP:521 Title:Managing global context via 'with' blocks in generators and coroutines Author:Nathaniel J. Smith <njs at pobox.com> Status:Withdrawn Type:Standards Track Created:27-Apr-2015 Python-Version:3.6 Post-History:29-Apr-2015 Contents PEP Withdrawal Abstract Specification Nested blocks Other changes Rationale Alternative approaches Backwards compatibility Interaction with PEP 492 References Copyright PEP Withdrawal Withdrawn in favor of PEP 567. Abstract While w...
...PEP you could implement all the examples using a class (similar to example 6, which is easily turned into a template). But the key idea is using a generator to drive a block statement; the rest is elaboration, so I'd like to keep these two parts together. (PEP 342, Enhanced Iterators, was originally a part of this PEP; but the two proposals are really independent and with Steven Bethard's help I have moved it to a separate PEP.) Rejection Notice I am rejecting this PEP in favor of PEP 343. S...
...PEP started its life as PEP 344. Since it is now targeted for Python 3000, it has been moved into the 3xxx space. Abstract This PEP proposes three standard attributes on exception instances: the __context__ attribute for implicitly chained exceptions, the __cause__ attribute for explicitly chained exceptions, and the __traceback__ attribute for the traceback. A new raise ... from statement sets the __cause__ attribute. Motivation During the handling of one exception (exception A), it is po...
...PEP has been renumbered to PEP 3134. The text below is the last version submitted under the old number. Abstract This PEP proposes three standard attributes on exception instances: the __context__ attribute for implicitly chained exceptions, the __cause__ attribute for explicitly chained exceptions, and the __traceback__ attribute for the traceback. A new raise ... from statement sets the __cause__ attribute. Motivation During the handling of one exception (exception A), it is possible tha...
...PEP 3099. General goals A general goal is to reduce feature duplication by removing old ways of doing things. A general principle of the design will be that one obvious way of doing something is enough. [1] Influencing PEPs PEP 238 (Changing the Division Operator) PEP 328 (Imports: Multi-Line and Absolute/Relative) PEP 343 (The "with" Statement) PEP 352 (Required Superclass for Exceptions) Style changes The C style guide will be updated to use 4-space indents, never tabs. This style sh...
...PEP, and I think you've done a great job moderating the discussion, collecting objections, reviewing alternatives, and everything else that is required to turn a heated debate into a PEP. Well done Chris (and everyone who helped), and good luck with your next PEP! """ Abstract Just as PEP 308 introduced a means of value-based conditions in an expression, this system allows exception-based conditions to be used as part of an expression. Motivation A number of functions and methods have parame...
...PEPs Numerical Index Reserved PEP Numbers PEP Types Key PEP Status Key Authors/Owners Introduction This PEP contains the index of all Python Enhancement Proposals, known as PEPs. PEP numbers are assigned by the PEP editors, and once assigned are never changed. The version control history of the PEP texts represent their historical record. Index by Category Meta-PEPs (PEPs about PEPs or Processes) PEP PEP Title PEP Author(s) P 1 PEP Purpose and Guidelines Warsaw, Hylton, Goo...