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 204 -- Range Literals PEP:204 Title:Range Literals Author:thomas at python.org (Thomas Wouters) Status:Rejected Type:Standards Track Created:14-Jul-2000 Python-Version:2.0 Post-History: Contents Introduction List ranges Slice Indices The Proposed Solution Reference Implementation Open issues Rejection Copyright References Introduction This PEP describes the "range literal" proposal for Python 2.0. This PEP tracks the status and ownership of this feature, slated for intr...
...Slicing PEP:357 Title:Allowing Any Object to be Used for Slicing Author:Travis Oliphant <oliphant at ee.byu.edu> Status:Final Type:Standards Track Created:09-Feb-2006 Python-Version:2.5 Post-History: Contents Abstract Rationale Proposal Specification Implementation Plan Discussion Questions Speed Why not use nb_int which is already there? Why the name __index__? Why return PyObject * from nb_index? Why can't __index__ return any object with the nb_index method? Referen...
...slicing notation e.g. a[2:10] will produce a slice object, or a tuple containing slice objects if multiple values were passed. Except for its unique ability to handle slice notation, the indexing operation has similarities to a plain method call: it acts like one when invoked with only one element; If the number of elements is greater than one, the idx argument behaves like a *args. However, as stated in the Motivation section, an indexing operation has the strong semantic implication of extrac...
...slicing behavior (it returns new strings instead of buffers for slicing and other operations), and it doesn't make many of the promises on alignment or being able to release the GIL that the bytes object does. Also in regards to the buffer object, it is not possible to simply replace the buffer object with the bytes object and maintain backwards compatibility. The buffer object provides a mechanism to take the PyBufferProcs supplied pointer of another object and present it as its own. Since th...
...Slicing Slicing a bytes object returns a bytes object. Slicing a bytearray object returns a bytearray object. Slice assignment to a bytearray object accepts anything that implements the PEP 3118 buffer API, or an iterable of integers in range(256). Indexing Indexing bytes and bytearray returns small ints (like the bytes type in 3.0a1, and like lists or array.array('B')). Assignment to an item of a bytearray object accepts an int in range(256). (To assign from a bytes sequence, use a slice as...
...Slicing syntax returns a copy The slicing syntax in Numeric 1 returns a view into the original array. The slicing behavior for Numeric 2 will be a copy. You should use the ArrayView class to get a view into an array. Boolean comparisons return a boolean array A comparison between arrays in Numeric 1 results in a Boolean scalar, because of current limitations in Python. The advent of Rich Comparisons in Python 2.1 will allow an array of Booleans to be returned. Type characters are deprecated...
PEP 368 -- Standard image protocol and class PEP:368 Title:Standard image protocol and class Author:Lino Mastrodomenico <l.mastrodomenico at gmail.com> Status:Deferred Type:Standards Track Created:28-Jun-2007 Python-Version:2.6, 3.0 Post-History: Contents Abstract PEP Deferral Rationale Specification Python API Mode Objects Image Protocol Image and ImageMixin Classes Line Objects Pixel Objects ImageSize Class C API Examples Backwards Compatibility Reference Implement...
PEP 637 -- Support for indexing with keyword arguments PEP:637 Title:Support for indexing with keyword arguments Author:Stefano Borini Sponsor:Steven D'Aprano Discussions-To:python-ideas at python.org Status:Rejected Type:Standards Track Created:24-Aug-2020 Python-Version:3.10 Post-History:23-Sep-2020 Resolution:https://mail.python.org/archives/list/python-dev@python.org/thread/6TAQ2BEVSJNV4JM2RJYSSYFJUT3INGZD/ Contents Abstract Overview Background Use cases Current status ...
...slicing" and a function is said to have self slicing if cr_self is NULL and CCALL_SELFARG is set. Note that a CCALL_NOARGS function with self slicing effectively has one argument, namely self. Analogously, a CCALL_O function with self slicing has two arguments. Descriptor behavior Classes supporting the C call protocol must implement the descriptor protocol in a specific way. This is required for an efficient implementation of bound methods: if other code can make assumptions on what __get__ d...
...slicing, so negative values count from the end of the list. (New in 2.3b1.) As of 2.3b2, list.index() now accepts optional start and end arguments. New-style classes that don't define __new__ or __init__ no longer ignore constructor arguments. (New in 2.3a2.) Hex/oct literals prefixed with a minus sign were handled inconsistently. This has been fixed in accordance with PEP 237. (New in 2.3a2.) Functions now have a __module__ attribute too. (New in 2.3a2.) Passing a float to C functions exp...
...slicing. Extended slicing has nothing to do with exceptions, so it's not clear to someone inspecting an exception object why __cause__ should be set to Ellipsis. Using Ellipsis by default for __cause__ makes it asymmetrical with __context__. Proposal A new attribute on BaseException, __suppress_context__, will be introduced. Whenever __cause__ is set, __suppress_context__ will be set to True. In particular, raise exc from cause syntax will set exc.__suppress_context__ to True. Exception printi...
...slicing and a function is said to have self slicing if m_self == NULL and METH_CALL_UNBOUND is not set. Note that a METH_NOARGS function which has self slicing effectively has one argument, namely self. Analogously, a METH_O function with self slicing has two arguments. METH_PASS_FUNCTION If this flag is set, then the C function is called with an additional first argument, namely the function itself (the base_function instance). As special case, if the function is a bound_method, then the unde...
Pi-thon 2022 PSF Spring Fundraiser Pi-thon 2022 PSF Spring Fundraiser Launching on a very special day on the calendar, we invite you to honor the PSF and our favorite Greek letter and irrational number with a gift to support the Python ecosystem. ALL donors who give any multiple of š¯›‘ will receive a special digital š¯›‘SF swag bag. Show your love for our Python community and contribute to the Spring Fundraiser by May 3rd to get your slice of the pi! We arenā€™t setting a spec...
Python Success Stories Introduction ForecastWatch.com, a service of Intellovations, is in the business of rating the accuracy of weather reports from companies such as Accuweather, MyForecast.com, and The Weather Channel. Over 36,000 weather forecasts are collected every day for over 800 U.S. cities, and later compared with actual climatological data. These comparisons are used by meteorologists to improve their weather forecasts, and to compare their forecasts with others. They are also used...
PEP 3099 -- Things that will Not Change in Python 3000 PEP:3099 Title:Things that will Not Change in Python 3000 Author:Georg Brandl <georg at python.org> Status:Final Type:Process Created:04-Apr-2006 Post-History: Contents Abstract Core language Builtins Standard types Coding style Interactive Interpreter Copyright Abstract Some ideas are just bad. While some thoughts on Python evolution are constructive, some go against the basic tenets of Python so egregiously that...
PEP 358 -- The "bytes" Object PEP:358 Title:The "bytes" Object Author:Neil Schemenauer <nas at arctrix.com>, Guido van Rossum <guido at python.org> Status:Final Type:Standards Track Created:15-Feb-2006 Python-Version:2.6, 3.0 Post-History: Contents Update Abstract Motivation Specification Out of Scope Issues Open Issues Frequently Asked Questions Copyright Update This PEP has partially been superseded by PEP 3137. Abstract This PEP outlines the intro...
...slicing: for value in seqn[::-1]: print value Revised code using the reversed function: for value in reversed(seqn): print value Python 2.3 or Later Testing String Membership In Python 2.3, for string2 in string1, the length restriction on string2 is lifted; it can now be a string of any length. When searching for a substring, where you don't care about the position of the substring in the original string, using the in operator makes the meaning clear. Pattern: string1.find(str...
...slicing in the ith dimension would add to the suboffsets in the (i-1)st dimension. Slicing in the first dimension would change the location of the starting pointer directly (i.e. buf would be modified). itemsize This is a storage for the itemsize (in bytes) of each element of the shared memory. It is technically un-necessary as it can be obtained using PyBuffer_SizeFromFormat, however an exporter may know this information without parsing the format string and it is necessary to know the items...
Python Humor Here is a spurious collection of semi to totally unserious stuff, mostly postings found wafting gently in the comp.lang.python newsgroup (a.k.a. the python-list mailing list). See also Andrew Kuchling's collection of Python quotations, containing in a condensed form some sterling examples of the wit and wisdom encountered in the Python world. Contents The Zen of Python Fundamental... Cute Wabbit Shooting Yourself in the Foot Legal Issues Python vs Tcl vs Perl5 Python Object Orie...
Version: None
Released: Oct. 5, 2020
This is the stable release of Python 3.9.0 Note: The release you're looking at is Python 3.9.0, a legacy release. Python 3.11 is now the latest feature release series of Python 3. Get the latest release of 3.11.x here. Installer news This is the first version of Python to ā€¦
View Release Notes