DAGDA SEARCH | Back to results | Support

Mailman 3 July 2017 - Python-Dev - python.org

Source: https://mail.python.org/archives/list/python-dev@python.org/2017/7/

Keyboard Shortcuts

Thread View

Python-Dev

Download Threads by month python-dev@python.org

July 2017

PEP 448 review
by Guido van Rossum March 29, 2023
March 29, 2023 I'm back, I've re-read the PEP, and I've re-read the long thread with "(no subject)". I think Georg Brandl nailed it: """ *I like the "sequence and dict flattening" part of the PEP, mostly because itis consistent and should be easy to understand, but the comprehension syntaxenhancements seem to be bad for readability and "comprehending" what the codedoes.The call syntax part is a mixed bag on the one hand it is nice to be consistent with the extended possibilities in literals (flattening), but on the other hand there would be small but annoying inconsistencies anyways (e.g. the duplicate kwarg case above).* """ Greg Ewing followed up explaining that the inconsistency between dict flattening and call syntax is inherent in the pre-existing different rules for dicts vs. keyword args: {'a':1, 'a':2} results in {'a':2}, while f(a=1, a=2) is an error. (This form is a SyntaxError; the dynamic case f(a=1, **{'a': 1}) is a TypeError.) For me, allowing f(*a, *b) and f(**d, **e) and all the other combinations for function calls proposed by the PEP is an easy +1 -- it's a straightforward extension of the existing pattern, and anybody who knows what f(x, *a) does will understand f(x, *a, y, *b). Guessing what f(**d, **e) means shouldn't be hard either. Understanding the edge case for duplicate keys with f(**d, **e) is a little harder, but the error messages are pretty clear, and it is not a new edge case. The sequence and dict flattening syntax proposals are also clean and logical -- we already have *-unpacking on the receiving side, so allowing *x in tuple expressions reads pretty naturally (and the similarity with *a in argument lists certainly helps). From here, having [a, *x, b, *y] is also natural, and then the extension to other displays is natural: {a, *x, b, *y} and {a:1, **d, b:2, **e}. This, too, gets a +1 from me. So that leaves comprehensions. IIRC, during the development of the patch we realized that f(*x for x in xs) is sufficiently ambiguous that we decided to disallow it -- note that f(x for x in xs) is already somewhat of a special case because an argument can only be a "bare" generator expression if it is the only argument. The same reasoning doesn't apply (in that form) to list, set and dict comprehensions -- while f(x for x in xs) is identical in meaning to f((x for x in xs)), [x for x in xs] is NOT the same as [(x for x in xs)] (that's a list of one element, and the element is a generator expression). The basic premise of this part of the proposal is that if you have a few iterables, the new proposal (without comprehensions) lets you create a list or generator expression that iterates over all of them, essentially flattening them: >>> xs = [1, 2, 3] >>> ys = ['abc', 'def'] >>> zs = [99] >>> [*xs, *ys, *zs] [1, 2, 3, 'abc', 'def', 99] >>> But now suppose you have a list of iterables: >>> xss = [[1, 2, 3], ['abc', 'def'], [99]] >>> [*xss[0], *xss[1], *xss[2]] [1, 2, 3, 'abc', 'def', 99] >>> Wouldn't it be nice if you could write the latter using a comprehension? >>> xss = [[1, 2, 3], ['abc', 'def'], [99]] >>> [*xs for xs in xss] [1, 2, 3, 'abc', 'def', 99] >>> This is somewhat seductive, and the following is even nicer: the *xs position may be an expression, e.g.: >>> xss = [[1, 2, 3], ['abc', 'def'], [99]] >>> [*xs[:2] for xs in xss] [1, 2, 'abc', 'def', 99] >>> On the other hand, I had to explore the possibilities here by experimenting in the interpreter, and I discovered some odd edge cases (e.g. you can parenthesize the starred expression, but that seems a syntactic accident). All in all I am personally +0 on the comprehension part of the PEP, and I like that it provides a way to "flatten" a sequence of sequences, but I think very few people in the thread have supported this part. Therefore I would like to ask Neil to update the PEP and the patch to take out the comprehension part, so that the two "easy wins" can make it into Python 3.5 (basically, I am accepting two-thirds of the PEP :-). There is some time yet until alpha 2. I would also like code reviewers (Benjamin?) to start reviewing the patch <http://bugs.python.org/issue2292>, taking into account that the comprehension part needs to be removed. -- --Guido van Rossum (python.org/~guido) 7 17 PEP 1, PEP Purpose and Guidelines
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 congrats on 3.5! Alas, windows 7 users are having problems installing it
by Laura Creighton Sept. 15, 2019

Sept. 15, 2019 webmaster has already heard from 4 people who cannot install it. I sent them to the bug tracker or to python-list but they seem not to have gone either place. Is there some guide I should be sending them to, 'how to debug installation problems'? Laura 5 6 Python startup time
by Victor Stinner Oct. 10, 2018

Oct. 10, 2018 Hi, On Twitter, Raymond Hettinger wrote: "The decision making process on Python-dev is an anti-pattern, governed by anecdotal data and ambiguity over what problem is solved." https://twitter.com/raymondh/status/887069454693158912 About "anecdotal data", I would like to discuss the Python startup time. == Python 3.7 compared to 2.7 == First of all, on speed.python.org, we have: * Python 2.7: 6.4 ms with site, 3.0 ms without site (-S) * master (3.7): 14.5 ms with site, 8.4 ms without site (-S) Python 3.7 startup time is 2.3x slower with site (default mode), or 2.8x slower without site (-S command line option). (I will skip Python 3.4, 3.5 and 3.6 which are much worse than Python 3.7...) So if an user complained about Python 2.7 startup time: be prepared for a 2x - 3x more angry user when "forced" to upgrade to Python 3! == Mercurial vs Git, Python vs C, startup time == Startup time matters a lot for Mercurial since Mercurial is compared to Git. Git and Mercurial have similar features, but Git is written in C whereas Mercurial is written in Python. Quick benchmark on the speed.python.org server: * hg version: 44.6 ms +- 0.2 ms * git --version: 974 us +- 7 us Mercurial startup time is already 45.8x slower than Git whereas tested Mercurial runs on Python 2.7.12. Now try to sell Python 3 to Mercurial developers, with a startup time 2x - 3x slower... I tested Mecurial 3.7.3 and Git 2.7.4 on Ubuntu 16.04.1 using "python3 -m perf command -- ...". == CPython core developers don't care? no, they do care == Christian Heimes, Naoki INADA, Serhiy Storchaka, Yury Selivanov, me (Victor Stinner) and other core developers made multiple changes last years to reduce the number of imports at startup, optimize impotlib, etc. IHMO all these core developers are well aware of the competition of programming languages, and honesty Python startup time isn't "good". So let's compare it to other programming languages similar to Python. == PHP, Ruby, Perl == I measured the startup time of other programming languages which are similar to Python, still on the speed.python.org server using "python3 -m perf command -- ...": * perl -e ' ': 1.18 ms +- 0.01 ms * php -r ' ': 8.57 ms +- 0.05 ms * ruby -e ' ': 32.8 ms +- 0.1 ms Wow, Perl is quite good! PHP seems as good as Python 2 (but Python 3 is worse). Ruby startup time seems less optimized than other languages. Tested versions: * perl 5, version 22, subversion 1 (v5.22.1) * PHP 7.0.18-0ubuntu0.16.04.1 (cli) ( NTS ) * ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu] == Quick Google search == I also searched for "python startup time" and "python slow startup time" on Google and found many articles. Some examples: "Reducing the Python startup time" http://www.draketo.de/book/export/html/498 => "The python startup time always nagged me (17-30ms) and I just searched again for a way to reduce it, when I found this: The Python-Launcher caches GTK imports and forks new processes to reduce the startup time of python GUI programs." https://nelsonslog.wordpress.com/2013/04/08/python-startup-time/ => "Wow, Python startup time is worse than I thought." "How to speed up python starting up and/or reduce file search while loading libraries?" https://stackoverflow.com/questions/15474160/how-to-speed-up-python-startin… => "The first time I log to the system and start one command it takes 6 seconds just to show a few line of help. If I immediately issue the same command again it takes 0.1s. After a couple of minutes it gets back to 6s. (proof of short-lived cache)" "How does one optimise the startup of a Python script/program?" https://www.quora.com/How-does-one-optimise-the-startup-of-a-Python-script-… => "I wrote a Python program that would be used very often (imagine 'cd' or 'ls') for very short runtimes, how would I make it start up as fast as possible?" "Python Interpreter Startup time" https://bytes.com/topic/python/answers/34469-pyhton-interpreter-startup-time "Python is very slow to start on Windows 7" https://stackoverflow.com/questions/29997274/python-is-very-slow-to-start-o… => "Python takes 17 times longer to load on my Windows 7 machine than Ubuntu 14.04 running on a VM" => "returns in 0.614s on Windows and 0.036s on Linux" "How to make a fast command line tool in Python" (old article Python 2.5.2) https://files.bemusement.org/talks/OSDC2008-FastPython/ => "(...) some techniques Bazaar uses to start quickly, such as lazy imports." -- So please continue efforts for make Python startup even faster to beat all other programming languages, and finally convince Mercurial to upgrade ;-) Victor 42 96 Python 3.3.7 release schedule and end-of-life
by Ned Deily Aug. 31, 2017

Aug. 31, 2017 Python 3.3 is fast approaching its end-of-life date, 2017-09-29. Per our release policy, that date is five years after the initial release of 3.3, 3.3.0 final on 2012-09-29. Note that 3.3 has been in security-fix only mode since the 2014-03-08 release of 3.3.5. It has been a while since we produced a 3.3.x security-fix release and, due to his commitments elsewhere, Georg has agreed for me to lead 3.3 to its well-deserved retirement. To that end, I would like to schedule its next, and hopefully final, security-fix release to coincide with the already announced 3.4.7 security-fix release. In particular, we'll plan to tag and release 3.3.7rc1 on Monday 2017-07-24 (UTC) and tag and release 3.3.7 final on Monday 2017-08-07. In the coming days, I'll be reviewing the outstanding 3.3 security issues and merging appropriate 3.3 PRs. Some of them have been sitting as patches for a long time so, if you have any such security issues that you think belong in 3.3, it would be very helpful if you would review such patches and turn them into 3.3 PRs. As a reminder, here are the guidelines from the devguide as to what is appropriate for a security-fix only branch: "The only changes made to a security branch are those fixing issues exploitable by attackers such as crashes, privilege escalation and, optionally, other issues such as denial of service attacks. Any other changes are not considered a security risk and thus not backported to a security branch. You should also consider fixing hard-failing tests in open security branches since it is important to be able to run the tests successfully before releasing." Note that documentation changes, other than any that might be related to a security fix, are also out of scope. Assuming no new security issues arise prior to the EOL date, 3.3.7 will likely be the final release of 3.3. And you really shouldn't be using 3.3 at all at this point; while downstream distributors are, of course, free to provide support of 3.3 to their customers, in a little over two months when EOL is reached python-dev will no longer accept any issues or make any changes available for 3.3. If you are still using 3.3, you really owe it to your applications, to your users, and to yourself to upgrade to a more recent release of Python 3, preferably 3.6! Many, many fixes, new features, and substantial performance improvements await you. https://www.python.org/dev/peps/pep-0398/ https://devguide.python.org/devcycle/#security-branches -- Ned Deily nad(a)python.org -- [] 3 2 Help requested with Python 2.7 performance regression
by Barry Warsaw Aug. 16, 2017

Aug. 16, 2017 Hello all, Over in Ubuntu, we've gotten reports about some performance regressions in Python 2.7 when moving from Trusty (14.04 LTS) to Xenial (16.04 LTS). Trusty's version is based on 2.7.6 while Xenial's version is based on 2.7.12 with bits of .13 cherry picked. We've not been able to identify any change in Python itself (or the Debian/Ubuntu deltas) which could account for this, so the investigation has led to various gcc compiler options and version differences. In particular disabling LTO (link-time optimization) seems to have a positive impact, but doesn't completely regain the loss. Louis (Cc'd here) has done a ton of work to measure and analyze the problem, but we've more or less hit a roadblock, so we're taking the issue public to see if anybody on this mailing list has further ideas. A detailed analysis is available in this Google doc: https://docs.google.com/document/d/1zrV3OIRSo99fd2Ty4YdGk_scmTRDmVauBprKL8e… The document should be public for comments and editing. If you have any thoughts, or other lines of investigation you think are worthwhile pursuing, please add your comments to the document. Cheers, -Barry 11 21 for...else
by Kiuhnm July 30, 2017

July 30, 2017 Hello, I think that the expression "for...else" or "while...else" is completely counter-intuitive. Wouldn't it be possible to make it clearer? Maybe something like break in for i in range(n): ... if cond: break else: ... I'm not an English native speaker so I don't know whether "break in" is acceptable English in this context or can only mean "to get into a building by force". Kiuhnm 14 18 Summary of Python tracker Issues
by Python tracker July 28, 2017

July 28, 2017 ACTIVITY SUMMARY (2017-07-21 - 2017-07-28) 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 6088 (+30) closed 36736 (+57) total 42824 (+87) Open issues with patches: 2337 Issues opened (72) ================== #26732: multiprocessing sentinel resource leak http://bugs.python.org/issue26732 reopened by haypo #28734: argparse: successive parsing wipes out nargs=? values http://bugs.python.org/issue28734 reopened by paul.j3 #29512: regrtest refleak: implement bisection feature http://bugs.python.org/issue29512 reopened by haypo #30188: test_nntplib: random EOFError in setUpClass() http://bugs.python.org/issue30188 reopened by haypo #30778: test_bsddb3 crash on x86 Windows XP 2.7 http://bugs.python.org/issue30778 reopened by haypo #30985: Set closing variable in asyncore at close http://bugs.python.org/issue30985 opened by walkhour #30986: Add --include-py argument to Tools/msi/make_zip.py http://bugs.python.org/issue30986 opened by Segev Finer #30987: Support for ISO-TP protocol in SocketCAN http://bugs.python.org/issue30987 opened by Pier-Yves Lessard #30988: Exception parsing invalid email address headers starting or en http://bugs.python.org/issue30988 opened by timb07 #30989: Sort only when needed in TimedRotatingFileHandler's getFilesTo http://bugs.python.org/issue30989 opened by Lovesh Harchandani #30990: Calls to C functions using `.__call__` don't get sent to profi http://bugs.python.org/issue30990 opened by ppperry #30991: test_ctypes ,test_dbm and test_ssl fail on arm64 (aarch64) ar http://bugs.python.org/issue30991 opened by jonny789 #30992: Invalid PGP Key Prevents Archive Validation http://bugs.python.org/issue30992 opened by cwprogram #30995: Support logging.getLogger(style='{') http://bugs.python.org/issue30995 opened by mitar #30996: add coroutine AbstractEventLoop.sock_close http://bugs.python.org/issue30996 opened by cfy #30997: TestCase.subTest and expectedFailure http://bugs.python.org/issue30997 opened by ronaldoussoren #30999: statistics module: add "key" keyword argument to median, mode, http://bugs.python.org/issue30999 opened by gerion #31000: Test failure in resource module on ZFS http://bugs.python.org/issue31000 opened by larry #31001: IDLE: Add tests for configdialog highlight tab http://bugs.python.org/issue31001 opened by terry.reedy #31002: IDLE: Add tests for configdialog keys tab http://bugs.python.org/issue31002 opened by terry.reedy #31004: IDLE, configdialog: Factor out FontTab class from ConfigDialog http://bugs.python.org/issue31004 opened by terry.reedy #31005: caught and stored exception creates a reference cycle outside http://bugs.python.org/issue31005 opened by vojtechfried #31006: typing.NamedTuple should add annotations to its constructor (_ http://bugs.python.org/issue31006 opened by Antony.Lee #31007: ERROR: test_pipe_handle (test.test_asyncio.test_windows_utils. http://bugs.python.org/issue31007 opened by haypo #31008: FAIL: test_wait_for_handle (test.test_asyncio.test_windows_eve http://bugs.python.org/issue31008 opened by haypo #31010: test_socketserver.test_ForkingTCPServer(): threading_cleanup() http://bugs.python.org/issue31010 opened by haypo #31011: Users (except from the one who installed) not able to see pyt http://bugs.python.org/issue31011 opened by Debarshi.Goswami #31012: suggestion: allow termination argument in argparse to be speci http://bugs.python.org/issue31012 opened by Leon Avery #31013: gcc7 throws warning when pymem.h development header is used http://bugs.python.org/issue31013 opened by Gabriel Somlo #31014: webbrowser._synthesize uses outdated calling signature for web http://bugs.python.org/issue31014 opened by jmsdvl #31015: PyErr_WriteUnraisable should be more verbose in Python 2.7 http://bugs.python.org/issue31015 opened by christian.aguilera(a)foundry.com #31016: [Regression] sphinx shows an EOF error when using python2.7 fr http://bugs.python.org/issue31016 opened by doko #31020: Add support for custom compressor in tarfile http://bugs.python.org/issue31020 opened by insomniacslk #31021: Clarify programming faq. http://bugs.python.org/issue31021 opened by terry.reedy #31022: ERROR: testRegularFile (test.test_socket.SendfileUsingSendTest http://bugs.python.org/issue31022 opened by haypo #31024: typing.Tuple is class but is defined as data inside https://do http://bugs.python.org/issue31024 opened by Bernát Gábor #31026: test_dbm fails when run directly http://bugs.python.org/issue31026 opened by serhiy.storchaka #31027: test_listcomps fails when run directly http://bugs.python.org/issue31027 opened by serhiy.storchaka #31028: test_pydoc fails when run directly http://bugs.python.org/issue31028 opened by serhiy.storchaka #31029: test_tokenize fails when run directly http://bugs.python.org/issue31029 opened by serhiy.storchaka #31030: sys.executable can be not normalized http://bugs.python.org/issue31030 opened by serhiy.storchaka #31031: Unify duplicate bits_in_digit and bit_length http://bugs.python.org/issue31031 opened by niklasf #31033: Add argument to .cancel() of Task and Future http://bugs.python.org/issue31033 opened by socketpair #31035: Document order of firing callbacks added with Future.add_done_ http://bugs.python.org/issue31035 opened by socketpair #31036: building the python docs requires the blurb module http://bugs.python.org/issue31036 opened by doko #31038: test_runpy causes running all Python tests when run directly http://bugs.python.org/issue31038 opened by serhiy.storchaka #31039: Python on android must use ashmem instead of shmem http://bugs.python.org/issue31039 opened by Alex Davies #31040: mimetypes.add_type should complain when you give it an undotte http://bugs.python.org/issue31040 opened by odd_bloke #31041: test_handle_called_with_mp_queue() of test_logging: threading_ http://bugs.python.org/issue31041 opened by haypo #31042: Inconsistency in documentation of operator.index http://bugs.python.org/issue31042 opened by madphysicist #31045: Add a language switch to the Python documentation http://bugs.python.org/issue31045 opened by mdk #31046: ensurepip does not honour the value of $(prefix) http://bugs.python.org/issue31046 opened by xdegaye #31047: Windows: os.path.isabs(os.path.abspath(" ")) == False http://bugs.python.org/issue31047 opened by lazka #31048: ResourceWarning in test_asyncio.test_events.ProactorEventLoopT http://bugs.python.org/issue31048 opened by Segev Finer #31050: IDLE, configdialog: Factor out GenTab class from ConfigDialog http://bugs.python.org/issue31050 opened by terry.reedy #31051: IDLE, configdialog, General tab: re-arrange, test user entries http://bugs.python.org/issue31051 opened by terry.reedy #31053: Unnecessary argument in command example http://bugs.python.org/issue31053 opened by cocoatomo #31054: Python 2.7.8 Release does not update the system Path variable http://bugs.python.org/issue31054 opened by Ekrem Saban #31055: All Sphinx generated pages could have a new "Edit This Page" l http://bugs.python.org/issue31055 opened by Paul Hammant #31056: Import Module Not Working According To Documentation Python 3. http://bugs.python.org/issue31056 opened by MrJman006 #31057: pydoc for tempfile.TemporaryDirectory should say it returns th http://bugs.python.org/issue31057 opened by Thomas Thurman #31059: asyncio.StreamReader.read hangs if n<0 http://bugs.python.org/issue31059 opened by s_kostyuk #31061: asyncio segfault when using threadpool and "_asyncio" native m http://bugs.python.org/issue31061 opened by thehesiod #31062: socket.makefile does not handle line buffering http://bugs.python.org/issue31062 opened by kchen #31064: test_ossaudiodev fails under padsp (Linux PulseAudio OSS emula http://bugs.python.org/issue31064 opened by ncoghlan #31065: Documentation for Popen.poll is unclear http://bugs.python.org/issue31065 opened by mark.dickinson #31066: FAIL: test_last_modified (test.test_httpservers.SimpleHTTPServ http://bugs.python.org/issue31066 opened by haypo #31067: test_subprocess.test_leak_fast_process_del_killed() fails rand http://bugs.python.org/issue31067 opened by haypo #31068: test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7 http://bugs.python.org/issue31068 opened by haypo #31069: test_multiprocessing_spawn leaked a process on AMD64 Windows8. http://bugs.python.org/issue31069 opened by haypo #31070: test_threaded_import: KeyError ignored in _get_module_lock.<lo http://bugs.python.org/issue31070 opened by haypo #31071: Bad error message about maps not iterable http://bugs.python.org/issue31071 opened by Stefan Pochmann Most recent 15 issues with no replies (15) ========================================== #31071: Bad error message about maps not iterable http://bugs.python.org/issue31071 #31070: test_threaded_import: KeyError ignored in _get_module_lock.<lo http://bugs.python.org/issue31070 #31069: test_multiprocessing_spawn leaked a process on AMD64 Windows8. http://bugs.python.org/issue31069 #31068: test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7 http://bugs.python.org/issue31068 #31062: socket.makefile does not handle line buffering http://bugs.python.org/issue31062 #31059: asyncio.StreamReader.read hangs if n<0 http://bugs.python.org/issue31059 #31054: Python 2.7.8 Release does not update the system Path variable http://bugs.python.org/issue31054 #31053: Unnecessary argument in command example http://bugs.python.org/issue31053 #31050: IDLE, configdialog: Factor out GenTab class from ConfigDialog http://bugs.python.org/issue31050 #31048: ResourceWarning in test_asyncio.test_events.ProactorEventLoopT http://bugs.python.org/issue31048 #31045: Add a language switch to the Python documentation http://bugs.python.org/issue31045 #31040: mimetypes.add_type should complain when you give it an undotte http://bugs.python.org/issue31040 #31039: Python on android must use ashmem instead of shmem http://bugs.python.org/issue31039 #31035: Document order of firing callbacks added with Future.add_done_ http://bugs.python.org/issue31035 #31031: Unify duplicate bits_in_digit and bit_length http://bugs.python.org/issue31031 Most recent 15 issues waiting for review (15) ============================================= #31046: ensurepip does not honour the value of $(prefix) http://bugs.python.org/issue31046 #31021: Clarify programming faq. http://bugs.python.org/issue31021 #31020: Add support for custom compressor in tarfile http://bugs.python.org/issue31020 #31015: PyErr_WriteUnraisable should be more verbose in Python 2.7 http://bugs.python.org/issue31015 #31013: gcc7 throws warning when pymem.h development header is used http://bugs.python.org/issue31013 #30978: str.format_map() silences exceptions in __getitem__ http://bugs.python.org/issue30978 #30950: Convert round() to Arument Clinic http://bugs.python.org/issue30950 #30945: loop.create_server does not detect if the interface is IPv6 en http://bugs.python.org/issue30945 #30937: csv module examples miss newline='' when opening files http://bugs.python.org/issue30937 #30877: possibe typo in json/scanner.py http://bugs.python.org/issue30877 #30872: Update curses docs to Python 3 http://bugs.python.org/issue30872 #30867: Add macro `HAVE_OPENSSL_VERIFY_PARAM` to avoid invalid functio http://bugs.python.org/issue30867 #30863: Rewrite PyUnicode_AsWideChar() and PyUnicode_AsWideCharString( http://bugs.python.org/issue30863 #30860: Consolidate stateful C globals under a single struct. http://bugs.python.org/issue30860 #30828: Out of bounds write in _asyncio_Future_remove_done_callback http://bugs.python.org/issue30828 Top 10 most discussed issues (10) ================================= #31036: building the python docs requires the blurb module http://bugs.python.org/issue31036 27 msgs #30853: IDLE: configdialog -- factor out Tracer subclass http://bugs.python.org/issue30853 16 msgs #30931: Race condition in asyncore may access the wrong dispatcher http://bugs.python.org/issue30931 11 msgs #30985: Set closing variable in asyncore at close http://bugs.python.org/issue30985 11 msgs #30923: Add -Wimplicit-fallthrough=0 to Makefile ? http://bugs.python.org/issue30923 10 msgs #9566: Compilation warnings under x64 Windows http://bugs.python.org/issue9566 8 msgs #5288: tzinfo objects with sub-minute offsets are not supported (e.g. http://bugs.python.org/issue5288 7 msgs #17611: Move unwinding of stack for "pseudo exceptions" from interpret http://bugs.python.org/issue17611 6 msgs #24954: No way to generate or parse timezone as produced by datetime.i http://bugs.python.org/issue24954 6 msgs #26732: multiprocessing sentinel resource leak http://bugs.python.org/issue26732 6 msgs Issues closed (52) ================== #13429: provide __file__ to extension init function http://bugs.python.org/issue13429 closed by scoder #20657: OpenBSD: Merge patches http://bugs.python.org/issue20657 closed by haypo #25287: test_crypt fails on OpenBSD http://bugs.python.org/issue25287 closed by haypo #26506: [EASY] hex() documentation: mention "%x" % int http://bugs.python.org/issue26506 closed by Mariatta #26642: Replace stdout and stderr with simple standard printers at Pyt http://bugs.python.org/issue26642 closed by haypo #26762: test_multiprocessing_spawn leaves processes running in backgro http://bugs.python.org/issue26762 closed by haypo #28095: test_startup_imports of test_site fails on OS X due to new imp http://bugs.python.org/issue28095 closed by ned.deily #28965: Multiprocessing spawn/forkserver fails to pass Queues http://bugs.python.org/issue28965 closed by pitrou #29403: mock's autospec's behavior on method-bound builtin functions i http://bugs.python.org/issue29403 closed by berker.peksag #29572: Upgrade installers to OpenSSL 1.0.2k http://bugs.python.org/issue29572 closed by ned.deily #29606: urllib FTP protocol stream injection http://bugs.python.org/issue29606 closed by haypo #29972: Skip tests known to fail on AIX http://bugs.python.org/issue29972 closed by haypo #30222: make_zip.py had a bug when setting up full 64 bit distribution http://bugs.python.org/issue30222 closed by steve.dower #30304: TestCase.assertMultiLineEqual only registered for Unicode stri http://bugs.python.org/issue30304 closed by Mariatta #30451: parse windows path error in webbrowser.get() and lead to webbr http://bugs.python.org/issue30451 closed by berker.peksag #30454: Python module cx_Oracle ld installation issue on Solaris11U3 S http://bugs.python.org/issue30454 closed by berker.peksag #30500: [security] urllib connects to a wrong host http://bugs.python.org/issue30500 closed by ned.deily #30595: test_queue_feeder_donot_stop_onexc() of test_multiprocessing_s http://bugs.python.org/issue30595 closed by haypo #30713: Reject newline character (U+000A) in URLs in urllib.parse http://bugs.python.org/issue30713 closed by haypo #30822: Python implementation of datetime module is not being tested c http://bugs.python.org/issue30822 closed by haypo #30850: [2.7] bsddb3: test01_basic_replication() of test_bsddb3 fails http://bugs.python.org/issue30850 closed by haypo #30876: SystemError on importing module from unloaded package http://bugs.python.org/issue30876 closed by serhiy.storchaka #30891: importlib: _find_and_load() race condition on sys.modules[name http://bugs.python.org/issue30891 closed by haypo #30892: _elementtree: assertion error if stdlib copy module is overrid http://bugs.python.org/issue30892 closed by haypo #30907: speed up comparisons to self for built-in containers http://bugs.python.org/issue30907 closed by wbolster #30908: test_os.TestSendfile.test_keywords() leaks dangling threads http://bugs.python.org/issue30908 closed by haypo #30916: Pre-build OpenSSL and Tcl/Tk for Windows http://bugs.python.org/issue30916 closed by steve.dower #30919: Shared Array Memory Allocation Regression http://bugs.python.org/issue30919 closed by pitrou #30939: Sphinx 1.6.3 deprecation warning for sphinx.util.compat.Direct http://bugs.python.org/issue30939 closed by ned.deily #30971: Improve code readability of json.tool http://bugs.python.org/issue30971 closed by rhettinger #30980: Calling asyncore.file_wrapper.close twice may close unrelated http://bugs.python.org/issue30980 closed by haypo #30981: IDLE: Test config dialog font bold button and sample change http://bugs.python.org/issue30981 closed by terry.reedy #30993: IDLE: Document, fix, and complete configdialog font tests http://bugs.python.org/issue30993 closed by terry.reedy #30994: Asyncore does not need to copy map.items() before polling http://bugs.python.org/issue30994 closed by Nir Soffer #30998: faulthandler: Show C stacktrace http://bugs.python.org/issue30998 closed by haypo #31003: IDLE: Add tests for help sources on configdialog general tab http://bugs.python.org/issue31003 closed by terry.reedy #31009: test_multiprocessing_spawn hangs randomly on AMD64 Windows10 3 http://bugs.python.org/issue31009 closed by haypo #31017: gcc 7 fallthrough warnings http://bugs.python.org/issue31017 closed by zach.ware #31018: _tracemalloc frame_t packing optimization not working in Windo http://bugs.python.org/issue31018 closed by haypo #31019: multiprocessing.Pool should join "dead" processes http://bugs.python.org/issue31019 closed by haypo #31023: Git Bootcamp and Cheat Sheet - Section 32.10 - Creating a Pul http://bugs.python.org/issue31023 closed by Mariatta #31025: io.BytesIO: no way to get the length of the underlying buffer http://bugs.python.org/issue31025 closed by rthr #31032: test_ssl http://bugs.python.org/issue31032 closed by christian.heimes #31034: test_subprocess_send_signal() of test_asyncio hangs if SIGHUP http://bugs.python.org/issue31034 closed by haypo #31037: Results in section 4.4 break and continue http://bugs.python.org/issue31037 closed by rhettinger #31043: Tests running twice. http://bugs.python.org/issue31043 closed by inada.naoki #31044: FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 Free http://bugs.python.org/issue31044 closed by haypo #31049: macOS Python package receipts do not have version numbers http://bugs.python.org/issue31049 closed by ned.deily #31052: smtplib not honoring bcc header http://bugs.python.org/issue31052 closed by r.david.murray #31058: FileFinder fails to find modules for import if modules are cre http://bugs.python.org/issue31058 closed by ncoghlan #31060: IDLE: Finish regrouping ConfigDialog methods http://bugs.python.org/issue31060 closed by terry.reedy #31063: List Comprehension Bug http://bugs.python.org/issue31063 closed by tim.peters 1 0 Non-stable pyc results on python 3.6
by jan matejek July 27, 2017

July 27, 2017 hello, we're seeing strange problems when trying to do reproducible builds of some python 3.6 modules. Namely, from one build to another, there will be something like the following difference in the compiled object: 00004e40 da 07 5f 5f 61 6c 6c 5f 5f da 0a 5f 5f 61 75 74 |..__all__..__aut| -00004e50 68 6f 72 5f 5f da 07 64 65 63 69 6d 61 6c 72 0c |hor__..decimalr.| +00004e50 68 6f 72 5f 5f 5a 07 64 65 63 69 6d 61 6c 72 0c |hor__Z.decimalr.| 00004e60 00 00 00 72 43 00 00 00 72 08 00 00 00 72 41 00 |...rC...r....rA.| This specific one is in the top-level co_names segment and the 0x5a vs 0xda byte is TYPE_SHORT_ASCII_INTERNED, with FLAG_REF set or unset. I'm also seeing off-by-one differences in reference ids, i.e., the number appearing after TYPE_REF. Not in all cases, but it seems that when a "part" is affected, all references in that "part" are changed (for some value of "part"; all the knowledge of pycs I have was gained from about an hour of reading marshal.c). So that seems to imply that there's a reference that is sometimes included and sometimes not? This is most often found in __init__.py. Often this affects optimized pycs, but we can see it in un-optimized as well. The issue is rare -- 99% of all pycs are stable -- but when it occurs, it's easy to replicate it in the same place. This also happens on different machines, so that seems to rule out hardware memory errors :) The pycs in question are generated by normal "setup.py build" -> "setup.py install". It happens on Python 3.6 but not on Python 2.7. I'm not sure about Python 3.5 because we don't currently use it. It doesn't seem to depend on hash seed - the instability is observed even with PYTHONHASHSEED set to zero. What seems to fix it, however, is running the build on disorderfs, which ensures that the filesystem entries are in the same order. Any ideas why something like this would happen and why would it be correlated with filesystem ordering? thanks m. 2 2 Appending a link back to bugs.python.org in GitHub PRs
by Brett Cannon July 26, 2017

July 26, 2017 Thanks to Kushal Das we now have one of the most requested features since the transition: a link in PRs back to bugs.python.org (in a more discoverable way since we have had them since Bedevere launched :) . When a pull request comes in with an issue number in the title (or one gets added), a link to bugs.python.org will be appended to the PR's body (the message you fill out when creating a PR). There's no logic to remove the link if the issue number is removed from the title, changed, or for multiple issue numbers since basically those cases are all rare and it was easier to launch without that kind of support. P.S.: Berker Peksag is working on providing commit emails with diffs in them which is the other most requested feature since the transition. 5 5