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 646 -- Variadic Generics PEP:646 Title:Variadic Generics Author:Mark Mendoza <mendoza.mark.a at gmail.com>, Matthew Rahtz <mrahtz at google.com>, Pradeep Kumar Srinivasan <gohanpra at gmail.com>, Vincent Siles <vsiles at fb.com> Sponsor:Guido van Rossum <guido at python.org> Status:Accepted Type:Standards Track Created:16-Sep-2020 Python-Version:3.11 Post-History:07-Oct-2020, 23-Dec-2020, 29-Dec-2020 Resolution:https://mail.python.org/archives/lis...
PEP 3128 -- BList: A Faster List-like Type PEP:3128 Title:BList: A Faster List-like Type Author:Daniel Stutzbach <daniel at stutzbachenterprises.com> Discussions-To:python-3000 at python.org Status:Rejected Type:Standards Track Created:30-Apr-2007 Python-Version:2.6, 3.0 Post-History:30-Apr-2007 Contents Rejection Notice Abstract Motivation Use Case Trade-offs Implementation Memory Usage Backwards Compatibility Reference Implementation Porting to Other Python Variants ...
...slicing a string, then they should consider whether there is a higher-level method that better communicates what the code should do rather than merely how the code should do it. The proposed removeprefix() and removesuffix() methods expand the high-level string "toolbox" and further allow for this sort of skepticism toward manual slicing. The main opportunity for user confusion will be the conflation of lstrip/rstrip with removeprefix/removesuffix. It may therefore be helpful to emphasize (as ...
...slicing) x*n, n*x (sequence-repeat) cmp(x1, x2) (comparisons) i in x (containment test) x.tolist() method x.start, x.stop, x.step attributes I also propose to change the signature of the PyRange_New() C API to remove the 4th argument (the repetition count). By implementing a custom iterator type, we could speed up the common use, but this is optional (the default sequence iterator does just fine). Scope This PEP affects the xrange() built-in function and the PyRange_New() C API. Risks Someb...
...slicing notation to specify sequences, changes to the syntax of for-in loops to allow the use of relational operators in the loop header, creation of an integer-interval class along with methods that overload relational operators or division operators to provide "slicing" on integer-interval objects, and more. It should be noted that there was much debate but not an overwhelming consensus for any of these larger-scale suggestions. Clearly, PEP 276 does not propose such a large-scale change and ...
...slicing on lists - Michael Hudson Make lists (and other builtin types) handle extended slices. Compression of Unicode database - Fredrik Lundh SF Patch 100899 At least for 2.0b1. May be included in 2.0 as a bug fix. Range literals - Thomas Wouters SF Patch 100902 We ended up having a lot of doubt about the proposal. Eliminated SET_LINENO opcode - Vladimir Marangozov Small optimization achieved by using the code object's lnotab instead of the SET_LINENO instruction. Uses code rewriting techn...
A Journey to Python by Alex Martelli, 2006 recipient of the Frank Willison Award After a quarter century of experience in programming (once as a sideline of my main job as a hardware designer, at Texas Instruments and IBM Research, but as my main job for over half that time, at IBM Research and Cad.Lab/think3), I finally stumbled upon Python in 1999. This was thanks to the kind nagging of a friend and colleague whose judgment I respected and to whom I still feel grateful for his insistence (A...
...slicing is a third approach that minimizes the code overhead but does nothing for memory efficiency, beauty, or clarity. Reverse iteration is much less common than forward iteration, but it does arise regularly in practice. See Real World Use Cases below. Proposal Add a builtin function called reversed() that makes a reverse iterator over sequence objects that support __getitem__() and __len__(). The above examples then simplify to: for i in reversed(xrange(n)): print seqn[i] for elem ...
...slicing; to avoid creating this temporary list, one has to resort to it = iter(seq) first = it.next() rest = list(it) Specification A tuple (or list) on the left side of a simple assignment (unpacking is not defined for augmented assignment) may contain at most one expression prepended with a single asterisk (which is henceforth called a "starred" expression, while the other expressions in the list are called "mandatory"). This designates a subexpression that will be assigned a list of all ...
...slicing: # Correct: dct['key'] = lst[index] # Wrong: dct ['key'] = lst [index] More than one space around an assignment (or other) operator to align it with another: # Correct: x = 1 y = 2 long_variable = 3 # Wrong: x = 1 y = 2 long_variable = 3 Other Recommendations Avoid trailing whitespace anywhere. Because it's usually invisible, it can be confusing: e.g. a backslash followed by a space and a newline does not count as a line continuation marker. Some e...
...slicing [Tip] and program paths [Ball] as techniques to help users understand where to make changes and what impact those changes will have. Slicing is a well-known technique for identifying subsets of programs that affect a particular variable. Analysis via program paths shows the various possible execution paths through a body of code. Each technique has value for testing and debugging programs. Two challenges are to apply these techniques across language boundaries and to identify abst...
PEP 353 -- Using ssize_t as the index type PEP:353 Title:Using ssize_t as the index type Author:Martin von Löwis <martin at v.loewis.de> Status:Final Type:Standards Track Created:18-Dec-2005 Post-History: Contents Abstract Rationale Specification Conversion guidelines Discussion Why not size_t Why not Py_intptr_t Doesn't this break much code? Doesn't this consume too much memory? Open Issues Copyright Abstract In Python 2.4, indices of sequences are restricted to the...
PEP 279 -- The enumerate() built-in function PEP:279 Title:The enumerate() built-in function Author:python at rcn.com (Raymond Hettinger) Status:Final Type:Standards Track Created:30-Jan-2002 Python-Version:2.3 Post-History: Contents Abstract Rationale BDFL Pronouncements Specification for a new built-in Copyright Abstract This PEP introduces a new built-in function, enumerate() to simplify a commonly used looping idiom. It provides all iterable collections with the same a...
Python 1.6 Python 1.6 Note: See the download pages for more recent releases. The final version of Python 1.6 is released on September 5, 2000. (What's new?) CNRI has placed an open source license on this version. CNRI believes that this version is compatible with the GPL, but there is a technicality concerning the choice of law provision, which Richard Stallman believes may make it incompatible. CNRI is still trying to work this out with Stallman. Future versions of Python ...
...Slicing ASCII became the default coding AST-based compiler Access to C AST from Python through new _ast module any()/all() builtin truth functions New standard library modules: cProfile -- suitable for profiling long running applications with minimal overhead ctypes -- optional component of the windows installer ElementTree and cElementTree -- by Fredrik Lundh hashlib -- adds support for SHA-224, -256, -384, and -512 (replaces old md5 and sha modules) msilib -- for creating MSI files and bdist...
PEP 434 -- IDLE Enhancement Exception for All Branches PEP:434 Title:IDLE Enhancement Exception for All Branches Author:Todd Rovito <rovitotv at gmail.com>, Terry Reedy <tjreedy at udel.edu> BDFL-Delegate:Nick Coghlan Status:Active Type:Informational Created:16-Feb-2013 Post-History:16-Feb-2013, 03-Mar-2013, 21-Mar-2013, 30-Mar-2013 Resolution:https://mail.python.org/pipermail/python-dev/2013-March/125003.html Contents Abstract Motivation Rationale Backwards Compa...
...slicing, so negative values count from the end of the list. This was the only place where such an interpretation was not placed on a list index. range() now works even if the arguments are longs with magnitude larger than sys.maxint, as long as the total length of the sequence fits. E.g., range(2**100, 2**101, 2**100) is the following list: [1267650600228229401496703205376L]. (SF patch #707427.) Some horridly obscure problems were fixed involving interaction between garbage collection and old...
...slicing, indexing, printing etc. Therefore, some have suggested that Unicode literals should not support surrogates. ISSUE Should Python allow the construction of characters that do not correspond to Unicode code points? Unassigned Unicode code points should obviously be legal (because they could be assigned at any time). But code points above TOPCHAR are guaranteed never to be used by Unicode. Should we allow access to them anyhow? Pro: If a Python user thinks they know what they're doing ...
PEP 284 -- Integer for-loops PEP:284 Title:Integer for-loops Author:David Eppstein <eppstein at ics.uci.edu>, Greg Ewing <greg.ewing at canterbury.ac.nz> Status:Rejected Type:Standards Track Created:01-Mar-2002 Python-Version:2.3 Post-History: Contents Abstract Pronouncement Rationale Specification Issues Implementation References Copyright Abstract This PEP proposes to simplify iteration over intervals of integers, by extending the range of expressions allowed ...
Python 1.6.1 Python 1.6.1 Note: See the download pages for more recent releases. What's new? Python 1.6 was the last of the versions developed at CNRI and the only version issued by CNRI with an open source license. Following the release of Python 1.6, and after Guido van Rossum left CNRI to work with commercial software developers, it became clear that the ability to use Python with software available under the GNU General Public License (GPL) was very desirable. CNRI and the Free Softwa...