Keyboard Shortcuts
Thread View
j: Next unread messagek: Previous unread messagej a: Jump to all threadsj l: Jump to MailingList overview
Python-Dev
Download Threads by month- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
May 2014
- 69 participants
- 50 discussions
by barry@zope.com May 18, 2021
May 18, 2021 It has been a while since I posted a copy of PEP 1 to the mailing lists and newsgroups. I've recently done some updating of a few sections, so in the interest of gaining wider community participation in the Python development process, I'm posting the latest revision of PEP 1 here. A version of the PEP is always available on-line at http://www.python.org/peps/pep-0001.html Enjoy, -Barry -------------------- snip snip -------------------- PEP: 1 Title: PEP Purpose and Guidelines Version: $Revision: 1.36 $ Last-Modified: $Date: 2002/07/29 18:34:59 $ Author: Barry A. Warsaw, Jeremy Hylton Status: Active Type: Informational Created: 13-Jun-2000 Post-History: 21-Mar-2001, 29-Jul-2002 What is a PEP? PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python. The PEP should provide a concise technical specification of the feature and a rationale for the feature. We intend PEPs to be the primary mechanisms for proposing new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python. The PEP author is responsible for building consensus within the community and documenting dissenting opinions. Because the PEPs are maintained as plain text files under CVS control, their revision history is the historical record of the feature proposal[1]. Kinds of PEPs There are two kinds of PEPs. A standards track PEP describes a new feature or implementation for Python. An informational PEP describes a Python design issue, or provides general guidelines or information to the Python community, but does not propose a new feature. Informational PEPs do not necessarily represent a Python community consensus or recommendation, so users and implementors are free to ignore informational PEPs or follow their advice. PEP Work Flow The PEP editor, Barry Warsaw <peps(a)python.org>, assigns numbers for each PEP and changes its status. The PEP process begins with a new idea for Python. It is highly recommended that a single PEP contain a single key proposal or new idea. The more focussed the PEP, the more successfully it tends to be. The PEP editor reserves the right to reject PEP proposals if they appear too unfocussed or too broad. If in doubt, split your PEP into several well-focussed ones. Each PEP must have a champion -- someone who writes the PEP using the style and format described below, shepherds the discussions in the appropriate forums, and attempts to build community consensus around the idea. The PEP champion (a.k.a. Author) should first attempt to ascertain whether the idea is PEP-able. Small enhancements or patches often don't need a PEP and can be injected into the Python development work flow with a patch submission to the SourceForge patch manager[2] or feature request tracker[3]. The PEP champion then emails the PEP editor <peps(a)python.org> with a proposed title and a rough, but fleshed out, draft of the PEP. This draft must be written in PEP style as described below. If the PEP editor approves, he will assign the PEP a number, label it as standards track or informational, give it status 'draft', and create and check-in the initial draft of the PEP. The PEP editor will not unreasonably deny a PEP. Reasons for denying PEP status include duplication of effort, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the Python philosophy. The BDFL (Benevolent Dictator for Life, Guido van Rossum) can be consulted during the approval phase, and is the final arbitrator of the draft's PEP-ability. If a pre-PEP is rejected, the author may elect to take the pre-PEP to the comp.lang.python newsgroup (a.k.a. python-list(a)python.org mailing list) to help flesh it out, gain feedback and consensus from the community at large, and improve the PEP for re-submission. The author of the PEP is then responsible for posting the PEP to the community forums, and marshaling community support for it. As updates are necessary, the PEP author can check in new versions if they have CVS commit permissions, or can email new PEP versions to the PEP editor for committing. Standards track PEPs consists of two parts, a design document and a reference implementation. The PEP should be reviewed and accepted before a reference implementation is begun, unless a reference implementation will aid people in studying the PEP. Standards Track PEPs must include an implementation - in the form of code, patch, or URL to same - before it can be considered Final. PEP authors are responsible for collecting community feedback on a PEP before submitting it for review. A PEP that has not been discussed on python-list(a)python.org and/or python-dev(a)python.org will not be accepted. However, wherever possible, long open-ended discussions on public mailing lists should be avoided. Strategies to keep the discussions efficient include, setting up a separate SIG mailing list for the topic, having the PEP author accept private comments in the early design phases, etc. PEP authors should use their discretion here. Once the authors have completed a PEP, they must inform the PEP editor that it is ready for review. PEPs are reviewed by the BDFL and his chosen consultants, who may accept or reject a PEP or send it back to the author(s) for revision. Once a PEP has been accepted, the reference implementation must be completed. When the reference implementation is complete and accepted by the BDFL, the status will be changed to `Final.' A PEP can also be assigned status `Deferred.' The PEP author or editor can assign the PEP this status when no progress is being made on the PEP. Once a PEP is deferred, the PEP editor can re-assign it to draft status. A PEP can also be `Rejected'. Perhaps after all is said and done it was not a good idea. It is still important to have a record of this fact. PEPs can also be replaced by a different PEP, rendering the original obsolete. This is intended for Informational PEPs, where version 2 of an API can replace version 1. PEP work flow is as follows: Draft -> Accepted -> Final -> Replaced ^ +----> Rejected v Deferred Some informational PEPs may also have a status of `Active' if they are never meant to be completed. E.g. PEP 1. What belongs in a successful PEP? Each PEP should have the following parts: 1. Preamble -- RFC822 style headers containing meta-data about the PEP, including the PEP number, a short descriptive title (limited to a maximum of 44 characters), the names, and optionally the contact info for each author, etc. 2. Abstract -- a short (~200 word) description of the technical issue being addressed. 3. Copyright/public domain -- Each PEP must either be explicitly labelled as placed in the public domain (see this PEP as an example) or licensed under the Open Publication License[4]. 4. Specification -- The technical specification should describe the syntax and semantics of any new language feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current Python platforms (CPython, JPython, Python .NET). 5. Motivation -- The motivation is critical for PEPs that want to change the Python language. It should clearly explain why the existing language specification is inadequate to address the problem that the PEP solves. PEP submissions without sufficient motivation may be rejected outright. 6. Rationale -- The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. 7. Backwards Compatibility -- All PEPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The PEP must explain how the author proposes to deal with these incompatibilities. PEP submissions without a sufficient backwards compatibility treatise may be rejected outright. 8. Reference Implementation -- The reference implementation must be completed before any PEP is given status 'Final,' but it need not be completed before the PEP is accepted. It is better to finish the specification and rationale first and reach consensus on it before writing code. The final implementation must include test code and documentation appropriate for either the Python language reference or the standard library reference. PEP Template PEPs are written in plain ASCII text, and should adhere to a rigid style. There is a Python script that parses this style and converts the plain text PEP to HTML for viewing on the web[5]. PEP 9 contains a boilerplate[7] template you can use to get started writing your PEP. Each PEP must begin with an RFC822 style header preamble. The headers must appear in the following order. Headers marked with `*' are optional and are described below. All other headers are required. PEP: <pep number> Title: <pep title> Version: <cvs version string> Last-Modified: <cvs date string> Author: <list of authors' real names and optionally, email addrs> * Discussions-To: <email address> Status: <Draft | Active | Accepted | Deferred | Final | Replaced> Type: <Informational | Standards Track> * Requires: <pep numbers> Created: <date created on, in dd-mmm-yyyy format> * Python-Version: <version number> Post-History: <dates of postings to python-list and python-dev> * Replaces: <pep number> * Replaced-By: <pep number> The Author: header lists the names and optionally, the email addresses of all the authors/owners of the PEP. The format of the author entry should be address(a)dom.ain (Random J. User) if the email address is included, and just Random J. User if the address is not given. If there are multiple authors, each should be on a separate line following RFC 822 continuation line conventions. Note that personal email addresses in PEPs will be obscured as a defense against spam harvesters. Standards track PEPs must have a Python-Version: header which indicates the version of Python that the feature will be released with. Informational PEPs do not need a Python-Version: header. While a PEP is in private discussions (usually during the initial Draft phase), a Discussions-To: header will indicate the mailing list or URL where the PEP is being discussed. No Discussions-To: header is necessary if the PEP is being discussed privately with the author, or on the python-list or python-dev email mailing lists. Note that email addresses in the Discussions-To: header will not be obscured. Created: records the date that the PEP was assigned a number, while Post-History: is used to record the dates of when new versions of the PEP are posted to python-list and/or python-dev. Both headers should be in dd-mmm-yyyy format, e.g. 14-Aug-2001. PEPs may have a Requires: header, indicating the PEP numbers that this PEP depends on. PEPs may also have a Replaced-By: header indicating that a PEP has been rendered obsolete by a later document; the value is the number of the PEP that replaces the current document. The newer PEP must have a Replaces: header containing the number of the PEP that it rendered obsolete. PEP Formatting Requirements PEP headings must begin in column zero and the initial letter of each word must be capitalized as in book titles. Acronyms should be in all capitals. The body of each section must be indented 4 spaces. Code samples inside body sections should be indented a further 4 spaces, and other indentation can be used as required to make the text readable. You must use two blank lines between the last line of a section's body and the next section heading. You must adhere to the Emacs convention of adding two spaces at the end of every sentence. You should fill your paragraphs to column 70, but under no circumstances should your lines extend past column 79. If your code samples spill over column 79, you should rewrite them. Tab characters must never appear in the document at all. A PEP should include the standard Emacs stanza included by example at the bottom of this PEP. A PEP must contain a Copyright section, and it is strongly recommended to put the PEP in the public domain. When referencing an external web page in the body of a PEP, you should include the title of the page in the text, with a footnote reference to the URL. Do not include the URL in the body text of the PEP. E.g. Refer to the Python Language web site [1] for more details. ... [1] http://www.python.org When referring to another PEP, include the PEP number in the body text, such as "PEP 1". The title may optionally appear. Add a footnote reference that includes the PEP's title and author. It may optionally include the explicit URL on a separate line, but only in the References section. Note that the pep2html.py script will calculate URLs automatically, e.g.: ... Refer to PEP 1 [7] for more information about PEP style ... References [7] PEP 1, PEP Purpose and Guidelines, Warsaw, Hylton http://www.python.org/peps/pep-0001.html If you decide to provide an explicit URL for a PEP, please use this as the URL template: http://www.python.org/peps/pep-xxxx.html PEP numbers in URLs must be padded with zeros from the left, so as to be exactly 4 characters wide, however PEP numbers in text are never padded. Reporting PEP Bugs, or Submitting PEP Updates How you report a bug, or submit a PEP update depends on several factors, such as the maturity of the PEP, the preferences of the PEP author, and the nature of your comments. For the early draft stages of the PEP, it's probably best to send your comments and changes directly to the PEP author. For more mature, or finished PEPs you may want to submit corrections to the SourceForge bug manager[6] or better yet, the SourceForge patch manager[2] so that your changes don't get lost. If the PEP author is a SF developer, assign the bug/patch to him, otherwise assign it to the PEP editor. When in doubt about where to send your changes, please check first with the PEP author and/or PEP editor. PEP authors who are also SF committers, can update the PEPs themselves by using "cvs commit" to commit their changes. Remember to also push the formatted PEP text out to the web by doing the following: % python pep2html.py -i NUM where NUM is the number of the PEP you want to push out. See % python pep2html.py --help for details. Transferring PEP Ownership It occasionally becomes necessary to transfer ownership of PEPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred PEP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the PEP process, or has fallen off the face of the 'net (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the PEP. We try to build consensus around a PEP, but if that's not possible, you can always submit a competing PEP. If you are interested assuming ownership of a PEP, send a message asking to take over, addressed to both the original author and the PEP editor <peps(a)python.org>. If the original author doesn't respond to email in a timely manner, the PEP editor will make a unilateral decision (it's not like such decisions can be reversed. :). References and Footnotes [1] This historical record is available by the normal CVS commands for retrieving older revisions. For those without direct access to the CVS tree, you can browse the current and past PEP revisions via the SourceForge web site at http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/python/nondist/peps/?cvsroot=… [2] http://sourceforge.net/tracker/?group_id=5470&atid=305470 [3] http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse [4] http://www.opencontent.org/openpub/ [5] The script referred to here is pep2html.py, which lives in the same directory in the CVS tree as the PEPs themselves. Try "pep2html.py --help" for details. The URL for viewing PEPs on the web is http://www.python.org/peps/ [6] http://sourceforge.net/tracker/?group_id=5470&atid=305470 [7] PEP 9, Sample PEP Template http://www.python.org/peps/pep-0009.html Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: 8 14
by Brett Cannon Feb. 27, 2015
Feb. 27, 2015 Here is some proposed wording. Since it is more of a clarification of what it takes to garner support -- which is just a new section -- rather than a complete rewrite I'm including just the diff to make it easier to read the changes. *diff -r 49d18bb47ebc pep-0011.txt* *--- a/pep-0011.txt Wed May 14 11:18:22 2014 -0400* *+++ b/pep-0011.txt Fri May 16 13:48:30 2014 -0400* @@ -2,22 +2,21 @@ Title: Removing support for little used platforms Version: $Revision$ Last-Modified: $Date$ -Author: martin(a)v.loewis.de (Martin von Löwis) +Author: Martin von Löwis <martin(a)v.loewis.de>, + Brett Cannon <brett(a)python.org> Status: Active Type: Process Content-Type: text/x-rst Created: 07-Jul-2002 Post-History: 18-Aug-2007 + 16-May-2014 Abstract -------- -This PEP documents operating systems (platforms) which are not -supported in Python anymore. For some of these systems, -supporting code might be still part of Python, but will be removed -in a future release - unless somebody steps forward as a volunteer -to maintain this code. +This PEP documents how an operating system (platform) garners +support in Python as well as documenting past support. Rationale @@ -37,16 +36,53 @@ change to the Python source code will work on all supported platforms. -To reduce this risk, this PEP proposes a procedure to remove code -for platforms with no Python users. +To reduce this risk, this PEP specifies what is required for a +platform to be considered supported by Python as well as providing a +procedure to remove code for platforms with little or no Python +users. +Supporting platforms +-------------------- + +Gaining official platform support requires two things. First, a core +developer needs to volunteer to maintain platform-specific code. This +core developer can either already be a member of the Python +development team or be given contributor rights on the basis of +maintaining platform support (it is at the discretion of the Python +development team to decide if a person is ready to have such rights +even if it is just for supporting a specific platform). + +Second, a stable buildbot must be provided [2]_. This guarantees that +platform support will not be accidentally broken by a Python core +developer who does not have personal access to the platform. For a +buildbot to be considered stable it requires that the machine be +reliably up and functioning (but it is up to the Python core +developers to decide whether to promote a buildbot to being +considered stable). + +This policy does not disqualify supporting other platforms +indirectly. Patches which are not platform-specific but still done to +add platform support will be considered for inclusion. For example, +if platform-independent changes were necessary in the configure +script which was motivated to support a specific platform that would +be accepted. Patches which add platform-specific code such as the +name of a specific platform to the configure script will generally +not be accepted without the platform having official support. + +CPU architecture and compiler support are viewed in a similar manner +as platforms. For example, to consider the ARM architecture supported +a buildbot running on ARM would be required along with support from +the Python development team. In general it is not required to have +a CPU architecture run under every possible platform in order to be +considered supported. Unsupporting platforms ---------------------- -If a certain platform that currently has special code in it is -deemed to be without Python users, a note must be posted in this -PEP that this platform is no longer actively supported. This +If a certain platform that currently has special code in Python is +deemed to be without Python users or lacks proper support from the +Python development team and/or a buildbot, a note must be posted in +this PEP that this platform is no longer actively supported. This note must include: - the name of the system @@ -69,8 +105,8 @@ forward and offer maintenance. -Resupporting platforms ----------------------- +Re-supporting platforms +----------------------- If a user of a platform wants to see this platform supported again, he may volunteer to maintain the platform support. Such an @@ -101,7 +137,7 @@ release is made. Developers of extension modules will generally need to use the same Visual Studio release; they are concerned both with the availability of the versions they need to use, and with keeping -the zoo of versions small. The Python source tree will keep +the zoo of versions small. The Python source tree will keep unmaintained build files for older Visual Studio releases, for which patches will be accepted. Such build files will be removed from the source tree 3 years after the extended support for the compiler has @@ -223,6 +259,7 @@ ---------- .. [1] http://support.microsoft.com/lifecycle/ +.. [2] http://buildbot.python.org/3.x.stable/ Copyright --------- 3 4
by Raymond Hettinger Jan. 3, 2015
Jan. 3, 2015 The current memory layout for dictionaries is unnecessarily inefficient. It has a sparse table of 24-byte entries containing the hash value, key pointer, and value pointer. Instead, the 24-byte entries should be stored in a dense table referenced by a sparse table of indices. For example, the dictionary: d = {'timmy': 'red', 'barry': 'green', 'guido': 'blue'} is currently stored as: entries = [['--', '--', '--'], [-8522787127447073495, 'barry', 'green'], ['--', '--', '--'], ['--', '--', '--'], ['--', '--', '--'], [-9092791511155847987, 'timmy', 'red'], ['--', '--', '--'], [-6480567542315338377, 'guido', 'blue']] Instead, the data should be organized as follows: indices = [None, 1, None, None, None, 0, None, 2] entries = [[-9092791511155847987, 'timmy', 'red'], [-8522787127447073495, 'barry', 'green'], [-6480567542315338377, 'guido', 'blue']] Only the data layout needs to change. The hash table algorithms would stay the same. All of the current optimizations would be kept, including key-sharing dicts and custom lookup functions for string-only dicts. There is no change to the hash functions, the table search order, or collision statistics. The memory savings are significant (from 30% to 95% compression depending on the how full the table is). Small dicts (size 0, 1, or 2) get the most benefit. For a sparse table of size t with n entries, the sizes are: curr_size = 24 * t new_size = 24 * n + sizeof(index) * t In the above timmy/barry/guido example, the current size is 192 bytes (eight 24-byte entries) and the new size is 80 bytes (three 24-byte entries plus eight 1-byte indices). That gives 58% compression. Note, the sizeof(index) can be as small as a single byte for small dicts, two bytes for bigger dicts and up to sizeof(Py_ssize_t) for huge dict. In addition to space savings, the new memory layout makes iteration faster. Currently, keys(), values, and items() loop over the sparse table, skipping-over free slots in the hash table. Now, keys/values/items can loop directly over the dense table, using fewer memory accesses. Another benefit is that resizing is faster and touches fewer pieces of memory. Currently, every hash/key/value entry is moved or copied during a resize. In the new layout, only the indices are updated. For the most part, the hash/key/value entries never move (except for an occasional swap to fill a hole left by a deletion). With the reduced memory footprint, we can also expect better cache utilization. For those wanting to experiment with the design, there is a pure Python proof-of-concept here: http://code.activestate.com/recipes/578375 YMMV: Keep in mind that the above size statics assume a build with 64-bit Py_ssize_t and 64-bit pointers. The space savings percentages are a bit different on other builds. Also, note that in many applications, the size of the data dominates the size of the container (i.e. the weight of a bucket of water is mostly the water, not the bucket). Raymond 27 70
by Eli Bendersky Oct. 15, 2014
Oct. 15, 2014 Hi all, https://github.com/python/cpython is now live as a semi-official, *read only* Github mirror of the CPython Mercurial repository. Let me know if you have any problems/concerns. I still haven't decided how often to update it (considering either just N times a day, or maybe use a Hg hook for batching). Suggestions are welcome. The methodology I used to create it is via hg-fast-export. I also tried to pack and gc the git repo as much as possible before the initial Github push - it went down from almost ~2GB to ~200MB (so this is the size of a fresh clone right now). Eli P.S. thanks Jesse for the keys to https://github.com/python 4 8
by Guido van Rossum Aug. 14, 2014
Aug. 14, 2014 I've received some enthusiastic emails from someone who wants to revive restricted mode. He started out with a bunch of patches to the CPython runtime using ctypes, which he attached to an App Engine bug: http://code.google.com/p/googleappengine/issues/detail?id=671 Based on his code (the file secure.py is all you need, included in secure.tar.gz) it seems he believes the only security leaks are __subclasses__, gi_frame and gi_code. (I have since convinced him that if we add "restricted" guards to these attributes, he doesn't need the functions added to sys.) I don't recall the exploits that Samuele once posted that caused the death of rexec.py -- does anyone recall, or have a pointer to the threads? -- --Guido van Rossum (home page: http://www.python.org/~guido/) 19 35
by Michael Haubenwallner June 2, 2014
June 2, 2014 Hello! Stumbling over problems on AIX (Modules/python.exp not found) building libxml2 as python module let me wonder about the intended use-cases for 'python-config' and 'pkg-config python'. FWIW, I can see these distinct use cases here, and I'm kindly asking if I got them right: * Build an application containing a python interpreter (like python$EXE itself): + link against libpython.so + re-export symbols from libpython.so for python-modules (platform-specific) + This is similar to build against any other library, thus = 'python.pc' is installed (for 'pkg-config python'). * Build a python-module (like build/lib.<platform>-<pyver>/*.so): + no need to link against libpython.so, instead + expect symbols from libpython.so to be available at runtime, platform-specific either as + undefined symbols at build-time (Linux, others), or + a list of symbols to import from "the main executable" (AIX) + This is specific to python-modules, thus = 'python-config' is installed. Thank you! /haubi/ 3 3
by Terry Reedy June 2, 2014
June 2, 2014 I have two areas of questions about updating turtle.py. First the module itself, then a turtle tracker issue versus code cleanup policies. A. Unlike most stdlib modules, turtle is copyrighted and licensed by an individual. ''' # turtle.py: a Tkinter based turtle graphics module for Python # Version 1.1b - 4. 5. 2009 # Copyright (C) 2006 - 2010 Gregor Lingl # email: glingl(a)aon.at ''' I am not sure what the copyright covers other than the exact text contributed, with updates, by Gregor. It certainly does not cover the API and whatever code he copied from the previous version (unless that was also by him, and I have no idea how much he copied when reimplementing). I don't think it should cover additions made by others either. Should there be another line to cover these? ''' # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software # in a product, an acknowledgment in the product documentation would be # appreciated but is not required. # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # 3. This notice may not be removed or altered from any source distribution. ''' As to point 2, the source has been altered a bit (by others) but it is not marked as such. How should it be? ''' _ver = "turtle 1.1b- - for Python 3.1 - 4. 5. 2009" ''' Obsolete; delete or alter (how)? When this replaced the previous turtle.py, it was considered 'owned' by Gregor in that changes had to go through him. However, he became inactive soon after and maintenance ceased. There has been only one turtle-specific code change that I know of (by Ned Daily, a month ago, for OSX. So is turtle.py unpatchable by anyone or fair game for anyone? A particular example: Gregor added intermediate layers to isolate turtle from tkinter. (He had a plan to add other backends, but I believe he abandoned that.) If someone wanted to reduce the layering and make the code easier to understand and maintain, while speeding execution, would that be allowed now? B. Lets assuming that turtle.py is, at least to some degree, fair game for fixes and enhancements. PSF Python PyLadies (Jessica Keller, Lynn Root) are participating in the 2014 GNOME Outreach Program for Women (OPW) https://wiki.python.org/moin/OPW/2014 . One of the projects (bottem of that page) is Graphical Python, in particular Turtle. A few days ago, Jessica posted http://bugs.python.org/issue21573 Clean up turtle.py code formatting "Lib/turtle.py has some code formatting issues. Let's clean them up to make the module easier to read as interns start working on it this summer." She want to follow cleanup with code examination, fixes, and enhancements. Responding today, I cautioned that clean-up only patches, such as she apparently would like to start with, are not in favor. But I cannot say how the policy applies to her proposal. Does the 'promise' of later work on the code make preliminary clean-up ok? Since she only marked the issue for 3.5, I also cautioned that 3.5-only cleanups would make fixing bugs in other issues harder. Is the code clean-up policy the same for all branches? Test? you ask?. There are apparently no unittests for turtle. On the other hand, turtledemo tests the overall function of the module and of many (most) of the top-level turtle functions. -- Terry Jan Reedy 5 10
by Glyph Lefkowitz May 31, 2014
May 31, 2014 At the language summit, Alex and I volunteered to put together some recommendations on what changes could be made to Python (the language) in order to facilitate a smoother transition from Python 2 to Python 3. One of the things that motivated this was the (surprising, to us) consideration that features like ensurepip might be added to the future versions of the 2.7 installers from python.org. The specific motivations for writing this are: Library maintainers have a rapidly expanding matrix that requires an increasing number of branches to satisfy. People with large corporate codebases absolutely cannot port all at once. If you don't have perfect test coverage then you can't make any progress. So these changes are intended to make porting from python 2 to python 3 more guided and incremental. We believe that these attributes are necessary. We would like to stress that we don't believe anything on this list is as important as the continuing efforts that everyone in the broader ecosystem is making. If you just want to ease the transition by working on anything at all, the best use of your time right now is porting https://warehouse.python.org/project/MySQL-python/ to Python 3. :) Nevertheless there are some things that the language and CPython could do. Unfortunately we had to reject any proposal that involved new __future__ imports, since unknown __future__ imports are un-catchable SyntaxErrors. Here are some ideas for Python 2.7+. Add ensurepip to the installers. Having pip reliably available increases the availability of libraries that help with porting, and will generally strengthen the broader ecosystem in the (increasingly long) transition period. Add some warnings about python 3 compatibility. It should at least be possible to get a warning for every single implicit string coercion. Old-style classes. Old-style division. Print statements. Old-style exception syntax. buffer(). bytes(memoryview(b'abc')) Importing old locations from the stdlib (see point 4.) Long integer syntax. Use of variables beyond the lifetime of an 'except Exception as e' block or a list comprehension. Backport 'yield from' to allow people to use Tulip and Tulip-compatible code, and to facilitate the development of Tulip-friendly libraries and a Tulip ecosystem. A robust Tulip ecosystem requires the participation of people who are not yet using Python 3. Add aliases for the renamed modules in the stdlib. This will allow people to "just write python 3" in a lot more circumstances. (re-)Enable warnings by default, including enabling -3 warnings. Right now all warnings are silent by default, which greatly reduces discoverability of future compatibility issues. I hope it's not controversial to say that most new Python code is still being written against Python 2.7 today; if people are writing that code in such a way that it's not 3-friendly, it should be a more immediately noticeable issue. Get rid of 2to3. Particularly, of any discussion of using 2to3 in the documentation. More than one very experienced, well-known Python developer in this discussion has told me that they thought 2to3 was the blessed way to port their code, and it's no surprise that they think so, given that the first technique <https://docs.python.org/3/howto/pyporting.html> mentions is still 2to3. We should replace 2to3 with something like <https://github.com/mitsuhiko/python-modernize>. 2to3 breaks your code on python 2, and doesn't necessarily get it running on python 3. A more conservative approach that reduced the amount of work to get your code 2/3 compatible but was careful to leave everything working would be a lot more effective. Add a new 'bytes' type that actually behaves like the Python 3 bytes type (bytes(5)). We have rejected any changes for Python 3.5, simply because of the extremely long time to get those features into users hands. Any changes for Python 3 that we're proposing would need to get into a 3.4.x release, so that, for example, they can make their way into Ubuntu 14.04 LTS. Here are some ideas for Python 3.4.x: Usage of Python2 style syntax (for example, a print statement) or stdlib module names (for example, 'import urllib2') should result in a specific, informative warning, not a generic SyntaxError/ImportError. This will really help new users. Add 'unicode' back as an alias for 'str'. Just today I was writing some documentation where I had to resort to some awkward encoding tricks just to get a bytes object out without explaining the whole 2/3 dichotomy in some unrelated prose. We'd like to thank all the individuals who gave input and feedback in creating this list. -glyph & Alex Gaynor 15 20
by Eric Snow May 30, 2014
May 30, 2014 On Fri, May 30, 2014 at 12:55 PM, brett.cannon <python-checkins(a)python.org> wrote: > http://hg.python.org/cpython/rev/b26d021081d2 > changeset: 90915:b26d021081d2 > parent: 90913:69011f6ce573 > user: Brett Cannon <brett(a)python.org> > date: Fri May 30 14:55:29 2014 -0400 > summary: > Issue #20383: Introduce importlib.util.module_from_spec(). > > diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py > --- a/Lib/importlib/_bootstrap.py > +++ b/Lib/importlib/_bootstrap.py > @@ -581,20 +581,19 @@ > return loader > > > -def _load_module_shim(self, fullname): > +def _load_module_shim(spec, fullname): > """Load the specified module into sys.modules and return it. This should have stayed "self", no? -eric 2 1
by Python tracker May 30, 2014
May 30, 2014 ACTIVITY SUMMARY (2014-05-23 - 2014-05-30) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open 4635 (+13) closed 28750 (+40) total 33385 (+53) Open issues with patches: 2127 Issues opened (41) ================== #16638: support multi-line docstring signatures in IDLE calltips http://bugs.python.org/issue16638 reopened by rhettinger #21561: help() on enum34 enumeration class creates only a dummy docume http://bugs.python.org/issue21561 opened by andymaier #21563: Segv during call to builtin_execfile in application embedding http://bugs.python.org/issue21563 opened by snoeberger #21564: Declaration of EVP_MD_CTX causes crash when switching between http://bugs.python.org/issue21564 opened by Ryan.Calhoun #21566: make use of the new default socket.listen() backlog argument http://bugs.python.org/issue21566 opened by neologix #21567: cannot create multipart alternative message with us-ascii char http://bugs.python.org/issue21567 opened by Viktor.Szépe #21568: Win32 pip doesn't use relative path to found site-packages. http://bugs.python.org/issue21568 opened by 勇刚.罗 #21569: PEP 466: Python 2.7 What's New preamble changes http://bugs.python.org/issue21569 opened by ncoghlan #21571: Python build should check CPATH, C_INCLUDE_PATH for module dep http://bugs.python.org/issue21571 opened by JanKanis #21572: Use generic license web page rather than requiring release-spe http://bugs.python.org/issue21572 opened by ned.deily #21573: Clean up turtle.py code formatting http://bugs.python.org/issue21573 opened by jesstess #21574: Port image types detections from PIL to the imghdr module http://bugs.python.org/issue21574 opened by serhiy.storchaka #21576: Overwritten (custom) uuid inside dictionary http://bugs.python.org/issue21576 opened by beta990 #21577: Help for ImportError should show a more useful signature. http://bugs.python.org/issue21577 opened by eric.snow #21578: Misleading error message when ImportError called with invalid http://bugs.python.org/issue21578 opened by eric.snow #21579: Python 3.4: tempfile.close attribute does not work http://bugs.python.org/issue21579 opened by mmarkk #21580: PhotoImage(data=...) apparently has to be UTF-8 or Base-64 enc http://bugs.python.org/issue21580 opened by vadmium #21581: Consider dropping importlib.abc.Loader.create_module() http://bugs.python.org/issue21581 opened by brett.cannon #21582: use support.catpured context managers - test_asyncore http://bugs.python.org/issue21582 opened by diana #21583: use support.catpured_stderr context manager - test_logging http://bugs.python.org/issue21583 opened by diana #21585: Run Tkinter tests with wantobjects=False http://bugs.python.org/issue21585 opened by serhiy.storchaka #21588: Idle: make editor title bar user configurable http://bugs.python.org/issue21588 opened by terry.reedy #21590: Systemtap and DTrace support http://bugs.python.org/issue21590 opened by bkabrda #21591: "exec(a, b, c)" not the same as "exec a in b, c" in nested fun http://bugs.python.org/issue21591 opened by Robert.Jordens #21592: Make statistics.median run in linear time http://bugs.python.org/issue21592 opened by Thomas.Dybdahl.Ahle #21593: Clarify re.search documentation first match http://bugs.python.org/issue21593 opened by Joshua.Landau #21594: asyncio.create_subprocess_exec raises OSError http://bugs.python.org/issue21594 opened by Sebastian.Kreft.Deezer #21595: Creating many subprocess generates lots of internal BlockingIO http://bugs.python.org/issue21595 opened by Sebastian.Kreft.Deezer #21596: asyncio.wait fails when futures list is empty http://bugs.python.org/issue21596 opened by Sebastian.Kreft.Deezer #21597: Allow turtledemo code pane to get wider. http://bugs.python.org/issue21597 opened by terry.reedy #21599: Argument transport in attach and detach method in Server class http://bugs.python.org/issue21599 opened by vajrasky #21600: mock.patch.stopall doesn't work with patch.dict to sys.modules http://bugs.python.org/issue21600 opened by kakuma #21601: Cancel method for Asyncio Task is not documented http://bugs.python.org/issue21601 opened by vajrasky #21603: IDLE SaveAs drops the extension in the prompted filename http://bugs.python.org/issue21603 opened by rhettinger #21604: Misleading 2to3 fixer name in documentation: standard_error http://bugs.python.org/issue21604 opened by wluebbe #21605: Add tests for Tkinter images http://bugs.python.org/issue21605 opened by serhiy.storchaka #21608: logging.handlers.HTTPHandler.setFormatter() has no effect http://bugs.python.org/issue21608 opened by bk2zsto #21610: load_module not closing opened files http://bugs.python.org/issue21610 opened by mattip #21611: int() docstring - unclear what number is http://bugs.python.org/issue21611 opened by and #21612: IDLE should not open multiple instances of one file http://bugs.python.org/issue21612 opened by irdb #21613: Installer for mac doesn't store the installation location http://bugs.python.org/issue21613 opened by ustinov Most recent 15 issues with no replies (15) ========================================== #21612: IDLE should not open multiple instances of one file http://bugs.python.org/issue21612 #21611: int() docstring - unclear what number is http://bugs.python.org/issue21611 #21605: Add tests for Tkinter images http://bugs.python.org/issue21605 #21604: Misleading 2to3 fixer name in documentation: standard_error http://bugs.python.org/issue21604 #21601: Cancel method for Asyncio Task is not documented http://bugs.python.org/issue21601 #21600: mock.patch.stopall doesn't work with patch.dict to sys.modules http://bugs.python.org/issue21600 #21599: Argument transport in attach and detach method in Server class http://bugs.python.org/issue21599 #21597: Allow turtledemo code pane to get wider. http://bugs.python.org/issue21597 #21596: asyncio.wait fails when futures list is empty http://bugs.python.org/issue21596 #21593: Clarify re.search documentation first match http://bugs.python.org/issue21593 #21591: "exec(a, b, c)" not the same as "exec a in b, c" in nested fun http://bugs.python.org/issue21591 #21582: use support.catpured context managers - test_asyncore http://bugs.python.org/issue21582 #21577: Help for ImportError should show a more useful signature. http://bugs.python.org/issue21577 #21568: Win32 pip doesn't use relative path to found site-packages. http://bugs.python.org/issue21568 #21564: Declaration of EVP_MD_CTX causes crash when switching between http://bugs.python.org/issue21564 Most recent 15 issues waiting for review (15) ============================================= #21610: load_module not closing opened files http://bugs.python.org/issue21610 #21608: logging.handlers.HTTPHandler.setFormatter() has no effect http://bugs.python.org/issue21608 #21605: Add tests for Tkinter images http://bugs.python.org/issue21605 #21601: Cancel method for Asyncio Task is not documented http://bugs.python.org/issue21601 #21599: Argument transport in attach and detach method in Server class http://bugs.python.org/issue21599 #21595: Creating many subprocess generates lots of internal BlockingIO http://bugs.python.org/issue21595 #21585: Run Tkinter tests with wantobjects=False http://bugs.python.org/issue21585 #21583: use support.catpured_stderr context manager - test_logging http://bugs.python.org/issue21583 #21582: use support.catpured context managers - test_asyncore http://bugs.python.org/issue21582 #21580: PhotoImage(data=...) apparently has to be UTF-8 or Base-64 enc http://bugs.python.org/issue21580 #21578: Misleading error message when ImportError called with invalid http://bugs.python.org/issue21578 #21572: Use generic license web page rather than requiring release-spe http://bugs.python.org/issue21572 #21566: make use of the new default socket.listen() backlog argument http://bugs.python.org/issue21566 #21564: Declaration of EVP_MD_CTX causes crash when switching between http://bugs.python.org/issue21564 #21563: Segv during call to builtin_execfile in application embedding http://bugs.python.org/issue21563 Top 10 most discussed issues (10) ================================= #21477: Idle: improve idle_test.htest http://bugs.python.org/issue21477 18 msgs #20383: Add a keyword-only spec argument to types.ModuleType http://bugs.python.org/issue20383 13 msgs #17172: Add turtledemo to IDLE menu http://bugs.python.org/issue17172 10 msgs #20611: socket.create_connection() doesn't handle EINTR properly http://bugs.python.org/issue20611 9 msgs #20689: socket.AddressFamily is absent in pydoc output http://bugs.python.org/issue20689 7 msgs #21579: Python 3.4: tempfile.close attribute does not work http://bugs.python.org/issue21579 7 msgs #3015: tkinter with wantobjects=False has been broken for some time http://bugs.python.org/issue3015 6 msgs #21235: importlib's spec module create algorithm is not exposed http://bugs.python.org/issue21235 6 msgs #8243: curses writing to window's bottom right position raises: `_cur http://bugs.python.org/issue8243 5 msgs #21561: help() on enum34 enumeration class creates only a dummy docume http://bugs.python.org/issue21561 5 msgs Issues closed (39) ================== #1641: asyncore delayed calls feature http://bugs.python.org/issue1641 closed by haypo #7094: Add alternate float formatting styles to new-style formatting. http://bugs.python.org/issue7094 closed by eric.smith #8743: set() operators don't work with collections.Set instances http://bugs.python.org/issue8743 closed by rhettinger #10203: sqlite3.Row doesn't support sequence protocol http://bugs.python.org/issue10203 closed by serhiy.storchaka #13742: Add a key parameter (like sorted) to heapq.merge http://bugs.python.org/issue13742 closed by rhettinger #14315: zipfile.ZipFile() unable to open zip File with a short extra h http://bugs.python.org/issue14315 closed by gregory.p.smith #14710: pkgutil.get_loader and find_loader fail when module is missing http://bugs.python.org/issue14710 closed by brett.cannon #15246: Line coverage for collectionts.abc.Set http://bugs.python.org/issue15246 closed by rhettinger #16774: Additional recipes for itertools docs http://bugs.python.org/issue16774 closed by rhettinger #19048: itertools.tee doesn't have a __sizeof__ method http://bugs.python.org/issue19048 closed by rhettinger #19925: Add unit test for spwd module http://bugs.python.org/issue19925 closed by serhiy.storchaka #20197: Support WebP image format detection in imghdr module http://bugs.python.org/issue20197 closed by serhiy.storchaka #21137: Better repr for threading.Lock() http://bugs.python.org/issue21137 closed by rhettinger #21343: os.path.relpath returns inconsistent types http://bugs.python.org/issue21343 closed by serhiy.storchaka #21376: asyncio docs refer to wrong TimeoutError http://bugs.python.org/issue21376 closed by haypo #21402: tkinter.ttk._val_or_dict assumes tkinter._default_root exists http://bugs.python.org/issue21402 closed by serhiy.storchaka #21434: python -3 documentation is outdated http://bugs.python.org/issue21434 closed by python-dev #21439: Numerous minor issues in Language Reference http://bugs.python.org/issue21439 closed by rhettinger #21454: asyncio's loop.connect_read_pipe makes pipes non-blocking cont http://bugs.python.org/issue21454 closed by haypo #21481: Argpase Namespace object methods __eq__ and __ne__ raise Type http://bugs.python.org/issue21481 closed by rhettinger #21493: Add test for ntpath.expanduser http://bugs.python.org/issue21493 closed by serhiy.storchaka #21513: speed up some ipaddress properties http://bugs.python.org/issue21513 closed by pitrou #21534: 404 on documentation download links http://bugs.python.org/issue21534 closed by benjamin.peterson #21546: int('\0') gives wrong error message http://bugs.python.org/issue21546 closed by terry.reedy #21555: gcmodule.c could use pytime.h http://bugs.python.org/issue21555 closed by pitrou #21558: Fix a typo in the contextlib docs http://bugs.python.org/issue21558 closed by rhettinger #21562: curses getsxy() should be curses getxy() in https://docs.pytho http://bugs.python.org/issue21562 closed by jcea #21565: multiprocessing: use contex-manager protocol for synchronizati http://bugs.python.org/issue21565 closed by neologix #21570: String being confused with datetime.datetime object. http://bugs.python.org/issue21570 closed by brandon #21575: list.sort() should show arguments in tutorial http://bugs.python.org/issue21575 closed by rhettinger #21584: Unraised overflow error in sqlite3.Row indexing http://bugs.python.org/issue21584 closed by serhiy.storchaka #21586: Minor error "How To Sockets" http://bugs.python.org/issue21586 closed by python-dev #21587: Tabs in source http://bugs.python.org/issue21587 closed by python-dev #21589: Use better idiom in unittest example http://bugs.python.org/issue21589 closed by ezio.melotti #21598: Is __getitem__ and __len__ implementations enough to make a us http://bugs.python.org/issue21598 closed by santa4nt #21602: smtplib.py socket.create_connection() also doesn't handle EINT http://bugs.python.org/issue21602 closed by neologix #21606: No visual feedback when entering japanese Characters in Entry http://bugs.python.org/issue21606 closed by ned.deily #21607: results of `zip` are displayed as '<zip object at 0xxxxxx> http://bugs.python.org/issue21607 closed by SilentGhost #21609: Documentation for datetime.datetime uses microseconds instead http://bugs.python.org/issue21609 closed by Miquel.Garcia 1 0