DAGDA SEARCH | Back to results | Support

Mailman 3 May 2016 - Python-Dev - python.org

Source: https://mail.python.org/archives/list/python-dev@python.org/2016/5/

Keyboard Shortcuts

Thread View

Python-Dev

Download Threads by month python-dev@python.org

May 2016

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 parser performance optimizations
by Artyom Skrobov Sept. 16, 2016

Sept. 16, 2016 Hello, Back in March, I've posted a patch at http://bugs.python.org/issue26526 -- "In parsermodule.c, replace over 2KLOC of hand-crafted validation code, with a DFA". The motivation for this patch was to enable a memory footprint optimization, discussed at http://bugs.python.org/issue26415 My proposed optimization reduces the memory footprint by up to 30% on the standard benchmarks, and by 200% on a degenerate case which sparked the discussion. The run time stays unaffected by this optimization. Python Developer's Guide says: "If you don't get a response within a few days after pinging the issue, then you can try emailing python-dev(a)python.org<mailto:python-dev@python.org> asking for someone to review your patch." So, here I am. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. 6 10 RFC: PEP 509: Add a private version to dict
by Victor Stinner Sept. 7, 2016

Sept. 7, 2016 Hi, I updated my PEP 509 to make the dictionary version globally unique. With *two* use cases of this PEP (Yury's method call patch and my FAT Python project), I think that the PEP is now ready to be accepted. Globally unique identifier is a requirement for Yury's patch optimizing method calls ( https://bugs.python.org/issue26110 ). It allows to check for free if the dictionary was replaced. I also renamed the ma_version field to ma_version_tag. HTML version: https://www.python.org/dev/peps/pep-0509/ Victor PEP: 509 Title: Add a private version to dict Version: $Revision$ Last-Modified: $Date$ Author: Victor Stinner <victor.stinner(a)gmail.com> Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 4-January-2016 Python-Version: 3.6 Abstract ======== Add a new private version to the builtin ``dict`` type, incremented at each dictionary creation and at each dictionary change, to implement fast guards on namespaces. Rationale ========= In Python, the builtin ``dict`` type is used by many instructions. For example, the ``LOAD_GLOBAL`` instruction searchs for a variable in the global namespace, or in the builtins namespace (two dict lookups). Python uses ``dict`` for the builtins namespace, globals namespace, type namespaces, instance namespaces, etc. The local namespace (namespace of a function) is usually optimized to an array, but it can be a dict too. Python is hard to optimize because almost everything is mutable: builtin functions, function code, global variables, local variables, ... can be modified at runtime. Implementing optimizations respecting the Python semantics requires to detect when "something changes": we will call these checks "guards". The speedup of optimizations depends on the speed of guard checks. This PEP proposes to add a version to dictionaries to implement fast guards on namespaces. Dictionary lookups can be skipped if the version does not change which is the common case for most namespaces. Since the version is globally unique, the version is also enough to check if the namespace dictionary was not replaced with a new dictionary. The performance of a guard does not depend on the number of watched dictionary entries, complexity of O(1), if the dictionary version does not change. Example of optimization: copy the value of a global variable to function constants. This optimization requires a guard on the global variable to check if it was modified. If the variable is modified, the variable must be loaded at runtime when the function is called, instead of using the constant. See the `PEP 510 -- Specialized functions with guards <https://www.python.org/dev/peps/pep-0510/>`_ for the concrete usage of guards to specialize functions and for the rationale on Python static optimizers. Guard example ============= Pseudo-code of an fast guard to check if a dictionary entry was modified (created, updated or deleted) using an hypothetical ``dict_get_version(dict)`` function:: UNSET = object() class GuardDictKey: def __init__(self, dict, key): self.dict = dict self.key = key self.value = dict.get(key, UNSET) self.version = dict_get_version(dict) def check(self): """Return True if the dictionary entry did not changed and the dictionary was not replaced.""" # read the version of the dict structure version = dict_get_version(self.dict) if version == self.version: # Fast-path: dictionary lookup avoided return True # lookup in the dictionary value = self.dict.get(self.key, UNSET) if value is self.value: # another key was modified: # cache the new dictionary version self.version = version return True # the key was modified return False Usage of the dict version ========================= Speedup method calls 1.2x ------------------------- Yury Selivanov wrote a `patch to optimize method calls <https://bugs.python.org/issue26110>`_. The patch depends on the `implement per-opcode cache in ceval <https://bugs.python.org/issue26219>`_ patch which requires dictionary versions to invalidate the cache if the globals dictionary or the builtins dictionary has been modified. The cache also requires that the dictionary version is globally unique. It is possible to define a function in a namespace and call it in a different namespace: using ``exec()`` with the *globals* parameter for example. In this case, the globals dictionary was changed and the cache must be invalidated. Specialized functions using guards ---------------------------------- The `PEP 510 -- Specialized functions with guards <https://www.python.org/dev/peps/pep-0510/>`_ proposes an API to support specialized functions with guards. It allows to implement static optimizers for Python without breaking the Python semantics. Example of a static Python optimizer: the `fatoptimizer <http://fatoptimizer.readthedocs.org/>`_ of the `FAT Python <http://faster-cpython.readthedocs.org/fat_python.html>`_ project implements many optimizations which require guards on namespaces. Examples: * Call pure builtins: to replace ``len("abc")`` with ``3``, guards on ``builtins.__dict__['len']`` and ``globals()['len']`` are required * Loop unrolling: to unroll the loop ``for i in range(...): ...``, guards on ``builtins.__dict__['range']`` and ``globals()['range']`` are required Pyjion ------ According of Brett Cannon, one of the two main developers of Pyjion, Pyjion can also benefit from dictionary version to implement optimizations. Pyjion is a JIT compiler for Python based upon CoreCLR (Microsoft .NET Core runtime). Unladen Swallow --------------- Even if dictionary version was not explicitly mentioned, optimizing globals and builtins lookup was part of the Unladen Swallow plan: "Implement one of the several proposed schemes for speeding lookups of globals and builtins." Source: `Unladen Swallow ProjectPlan <https://code.google.com/p/unladen-swallow/wiki/ProjectPlan>`_. Unladen Swallow is a fork of CPython 2.6.1 adding a JIT compiler implemented with LLVM. The project stopped in 2011: `Unladen Swallow Retrospective <http://qinsb.blogspot.com.au/2011/03/unladen-swallow-retrospective.html>`_. Changes ======= Add a ``ma_version_tag`` field to the ``PyDictObject`` structure with the C type ``PY_INT64_T``, 64-bit unsigned integer. Add also a global dictionary version. Each time a dictionary is created, the global version is incremented and the dictionary version is initialized to the global version. The global version is also incremented and copied to the dictionary version at each dictionary change: * ``clear()`` if the dict was non-empty * ``pop(key)`` if the key exists * ``popitem()`` if the dict is non-empty * ``setdefault(key, value)`` if the `key` does not exist * ``__detitem__(key)`` if the key exists * ``__setitem__(key, value)`` if the `key` doesn't exist or if the value is not ``dict[key]`` * ``update(...)`` if new values are different than existing values: values are compared by identity, not by their content; the version can be incremented multiple times The ``PyDictObject`` structure is not part of the stable ABI. The field is called ``ma_version_tag`` rather than ``ma_version`` to suggest to compare it using ``version_tag == old_version_tag`` rather than ``version <= old_version`` which makes the integer overflow much likely. Example using an hypothetical ``dict_get_version(dict)`` function:: >>> d = {} >>> dict_get_version(d) 100 >>> d['key'] = 'value' >>> dict_get_version(d) 101 >>> d['key'] = 'new value' >>> dict_get_version(d) 102 >>> del d['key'] >>> dict_get_version(d) 103 The version is not incremented if an existing key is set to the same value. For efficiency, values are compared by their identity: ``new_value is old_value``, not by their content: ``new_value == old_value``. Example:: >>> d = {} >>> value = object() >>> d['key'] = value >>> dict_get_version(d) 40 >>> d['key'] = value >>> dict_get_version(d) 40 .. note:: CPython uses some singleton like integers in the range [-5; 257], empty tuple, empty strings, Unicode strings of a single character in the range [U+0000; U+00FF], etc. When a key is set twice to the same singleton, the version is not modified. Implementation and Performance ============================== The `issue #26058: PEP 509: Add ma_version_tag to PyDictObject <https://bugs.python.org/issue26058>`_ contains a patch implementing this PEP. On pybench and timeit microbenchmarks, the patch does not seem to add any overhead on dictionary operations. When the version does not change, ``PyDict_GetItem()`` takes 14.8 ns for a dictionary lookup, whereas a guard check only takes 3.8 ns. Moreover, a guard can watch for multiple keys. For example, for an optimization using 10 global variables in a function, 10 dictionary lookups costs 148 ns, whereas the guard still only costs 3.8 ns when the version does not change (39x as fast). The `fat module <http://fatoptimizer.readthedocs.org/en/latest/fat.html>`_ implements such guards: ``fat.GuardDict`` is based on the dictionary version. Integer overflow ================ The implementation uses the C type ``PY_UINT64_T`` to store the version: a 64 bits unsigned integer. The C code uses ``version++``. On integer overflow, the version is wrapped to ``0`` (and then continue to be incremented) according to the C standard. After an integer overflow, a guard can succeed whereas the watched dictionary key was modified. The bug only occurs at a guard check if there are exaclty ``2 ** 64`` dictionary creations or modifications since the previous guard check. If a dictionary is modified every nanosecond, ``2 ** 64`` modifications takes longer than 584 years. Using a 32-bit version, it only takes 4 seconds. That's why a 64-bit unsigned type is also used on 32-bit systems. A dictionary lookup at the C level takes 14.8 ns. A risk of a bug every 584 years is acceptable. Alternatives ============ Expose the version at Python level as a read-only __version__ property ---------------------------------------------------------------------- The first version of the PEP proposed to expose the dictionary version as a read-only ``__version__`` property at Python level, and also to add the property to ``collections.UserDict`` (since this type must mimick the ``dict`` API). There are multiple issues: * To be consistent and avoid bad surprises, the version must be added to all mapping types. Implementing a new mapping type would require extra work for no benefit, since the version is only required on the ``dict`` type in practice. * All Python implementations must implement this new property, it gives more work to other implementations, whereas they may not use the dictionary version at all. * Exposing the dictionary version at Python level can lead the false assumption on performances. Checking ``dict.__version__`` at the Python level is not faster than a dictionary lookup. A dictionary lookup has a cost of 48.7 ns and checking a guard has a cost of 47.5 ns, the difference is only 1.2 ns (3%):: $ ./python -m timeit -s 'd = {str(i):i for i in range(100)}' 'd["33"] == 33' 10000000 loops, best of 3: 0.0487 usec per loop $ ./python -m timeit -s 'd = {str(i):i for i in range(100)}' 'd.__version__ == 100' 10000000 loops, best of 3: 0.0475 usec per loop * The ``__version__`` can be wrapped on integer overflow. It is error prone: using ``dict.__version__ <= guard_version`` is wrong, ``dict.__version__ == guard_version`` must be used instead to reduce the risk of bug on integer overflow (even if the integer overflow is unlikely in practice). Mandatory bikeshedding on the property name: * ``__cache_token__``: name proposed by Nick Coghlan, name coming from `abc.get_cache_token() <https://docs.python.org/3/library/abc.html#abc.get_cache_token>`_. * ``__version__`` * ``__timestamp__`` Add a version to each dict entry -------------------------------- A single version per dictionary requires to keep a strong reference to the value which can keep the value alive longer than expected. If we add also a version per dictionary entry, the guard can only store the entry version to avoid the strong reference to the value (only strong references to the dictionary and to the key are needed). Changes: add a ``me_version`` field to the ``PyDictKeyEntry`` structure, the field has the C type ``PY_INT64_T``. When a key is created or modified, the entry version is set to the dictionary version which is incremented at any change (create, modify, delete). Pseudo-code of an fast guard to check if a dictionary key was modified using hypothetical ``dict_get_version(dict)`` ``dict_get_entry_version(dict)`` functions:: UNSET = object() class GuardDictKey: def __init__(self, dict, key): self.dict = dict self.key = key self.dict_version = dict_get_version(dict) self.entry_version = dict_get_entry_version(dict, key) def check(self): """Return True if the dictionary entry did not changed and the dictionary was not replaced.""" # read the version of the dict structure dict_version = dict_get_version(self.dict) if dict_version == self.version: # Fast-path: dictionary lookup avoided return True # lookup in the dictionary entry_version = get_dict_key_version(dict, key) if entry_version == self.entry_version: # another key was modified: # cache the new dictionary version self.dict_version = dict_version return True # the key was modified return False The main drawback of this option is the impact on the memory footprint. It increases the size of each dictionary entry, so the overhead depends on the number of buckets (dictionary entries, used or unused yet). For example, it increases the size of each dictionary entry by 8 bytes on 64-bit system. In Python, the memory footprint matters and the trend is to reduce it. Examples: * `PEP 393 -- Flexible String Representation <https://www.python.org/dev/peps/pep-0393/>`_ * `PEP 412 -- Key-Sharing Dictionary <https://www.python.org/dev/peps/pep-0412/>`_ Add a new dict subtype ---------------------- Add a new ``verdict`` type, subtype of ``dict``. When guards are needed, use the ``verdict`` for namespaces (module namespace, type namespace, instance namespace, etc.) instead of ``dict``. Leave the ``dict`` type unchanged to not add any overhead (memory footprint) when guards are not needed. Technical issue: a lot of C code in the wild, including CPython core, expecting the exact ``dict`` type. Issues: * ``exec()`` requires a ``dict`` for globals and locals. A lot of code use ``globals={}``. It is not possible to cast the ``dict`` to a ``dict`` subtype because the caller expects the ``globals`` parameter to be modified (``dict`` is mutable). * Functions call directly ``PyDict_xxx()`` functions, instead of calling ``PyObject_xxx()`` if the object is a ``dict`` subtype * ``PyDict_CheckExact()`` check fails on ``dict`` subtype, whereas some functions require the exact ``dict`` type. * ``Python/ceval.c`` does not completely supports dict subtypes for namespaces The ``exec()`` issue is a blocker issue. Other issues: * The garbage collector has a special code to "untrack" ``dict`` instances. If a ``dict`` subtype is used for namespaces, the garbage collector can be unable to break some reference cycles. * Some functions have a fast-path for ``dict`` which would not be taken for ``dict`` subtypes, and so it would make Python a little bit slower. Prior Art ========= Method cache and type version tag --------------------------------- In 2007, Armin Rigo wrote a patch to to implement a cache of methods. It was merged into Python 2.6. The patch adds a "type attribute cache version tag" (``tp_version_tag``) and a "valid version tag" flag to types (the ``PyTypeObject`` structure). The type version tag is not available at the Python level. The version tag has the C type ``unsigned int``. The cache is a global hash table of 4096 entries, shared by all types. The cache is global to "make it fast, have a deterministic and low memory footprint, and be easy to invalidate". Each cache entry has a version tag. A global version tag is used to create the next version tag, it also has the C type ``unsigned int``. By default, a type has its "valid version tag" flag cleared to indicate that the version tag is invalid. When the first method of the type is cached, the version tag and the "valid version tag" flag are set. When a type is modified, the "valid version tag" flag of the type and its subclasses is cleared. Later, when a cache entry of these types is used, the entry is removed because its version tag is outdated. On integer overflow, the whole cache is cleared and the global version tag is reset to ``0``. See `Method cache (issue #1685986) <https://bugs.python.org/issue1685986>`_ and `Armin's method cache optimization updated for Python 2.6 (issue #1700288) <https://bugs.python.org/issue1700288>`_. Globals / builtins cache ------------------------ In 2010, Antoine Pitrou proposed a `Globals / builtins cache (issue #10401) <http://bugs.python.org/issue10401>`_ which adds a private ``ma_version`` field to the ``PyDictObject`` structure (``dict`` type), the field has the C type ``Py_ssize_t``. The patch adds a "global and builtin cache" to functions and frames, and changes ``LOAD_GLOBAL`` and ``STORE_GLOBAL`` instructions to use the cache. The change on the ``PyDictObject`` structure is very similar to this PEP. Cached globals+builtins lookup ------------------------------ In 2006, Andrea Griffini proposed a patch implementing a `Cached globals+builtins lookup optimization <https://bugs.python.org/issue1616125>`_. The patch adds a private ``timestamp`` field to the ``PyDictObject`` structure (``dict`` type), the field has the C type ``size_t``. Thread on python-dev: `About dictionary lookup caching <https://mail.python.org/pipermail/python-dev/2006-December/070348.html>`_. Guard against changing dict during iteration -------------------------------------------- In 2013, Serhiy Storchaka proposed `Guard against changing dict during iteration (issue #19332) <https://bugs.python.org/issue19332>`_ which adds a ``ma_count`` field to the ``PyDictObject`` structure (``dict`` type), the field has the C type ``size_t``. This field is incremented when the dictionary is modified, and so is very similar to the proposed dictionary version. Sadly, the dictionary version proposed in this PEP doesn't help to detect dictionary mutation. The dictionary version changes when values are replaced, whereas modifying dictionary values while iterating on dictionary keys is legit in Python. PySizer ------- `PySizer <http://pysizer.8325.org/>`_: a memory profiler for Python, Google Summer of Code 2005 project by Nick Smallbone. This project has a patch for CPython 2.4 which adds ``key_time`` and ``value_time`` fields to dictionary entries. It uses a global process-wide counter for dictionaries, incremented each time that a dictionary is modified. The times are used to decide when child objects first appeared in their parent objects. Discussion ========== Thread on the mailing lists: * python-dev: `PEP 509: Add a private version to dict <https://mail.python.org/pipermail/python-dev/2016-January/142685.html>`_ (january 2016) * python-ideas: `RFC: PEP: Add dict.__version__ <https://mail.python.org/pipermail/python-ideas/2016-January/037702.html>`_ (january 2016) Copyright ========= This document has been placed in the public domain. 15 37 New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512
by Christian Heimes June 12, 2016

June 12, 2016 Hi everybody, I have three hashing-related patches for Python 3.6 that are waiting for review. Altogether the three patches add ten new hash algorithms to the hashlib module: SHA3 (224, 256, 384, 512), SHAKE (SHA3 XOF 128, 256), BLAKE2 (blake2b, blake2s) and truncated SHA512 (224, 256). SHA-3 / SHAKE: https://bugs.python.org/issue16113 BLAKE2: https://bugs.python.org/issue26798 SHA512/224 / SHA512/256: https://bugs.python.org/issue26834 I like to push the patches during the sprints at PyCon. Please assist with reviews. Regards, Christian 13 34 Adding NewType() to PEP 484
by Ivan Levkivskyi June 2, 2016

June 2, 2016 Hi, It has been proposed to enhance the typing module with a NewType function that allows to define simple unique types with almost zero runtime overhead. The PR containing actual implementation and PEP 484 update is here: https://github.com/python/typing/pull/226 Review comments are very welcome. Best regards, Ivan 22 40 embedding - PyImport_AppendInittab() after Py_Initialize()
by Vitaly Murashev May 30, 2016

May 30, 2016 Could anyone please clarify whether it is correct in python3.5 to call PyImport_AppendInittab() after Py_Initialize() I found this case among the tests for boost.python https://github.com/boostorg/python/blob/develop/test/exec.cpp And this test doesn't work for me with python3.5.An error looks like: exec.cpp(137): Python Error detected in function 'void __cdecl check_pyerr(bool)' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: 'embedded_hello' is not a built-in module 1 error detected. After debugging I found out that root cause is in importlib/_bootstrap.py which do the following: if fullname not in sys.builtin_module_names: raise ImportError('{!r} is not a built-in module'.format(fullname), name=fullname) but sys.builtin_module_names is the constant which initialized once in Py_Initialize() --- To summarize: Is it a bug in python3.5 or original test inside boost.python should be fixed ? 2 1 Summary of Python tracker Issues
by Python tracker May 27, 2016

May 27, 2016 ACTIVITY SUMMARY (2016-05-20 - 2016-05-27) 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 5529 (+25) closed 33364 (+42) total 38893 (+67) Open issues with patches: 2400 Issues opened (46) ================== #16858: tarfile silently hides errors http://bugs.python.org/issue16858 reopened by mmarkk #26915: Test identity first in membership operation of ItemsView, Valu http://bugs.python.org/issue26915 reopened by xiang.zhang #27067: Improve curses tests http://bugs.python.org/issue27067 reopened by martin.panter #27072: random.getrandbits is limited to 2**31-1 bits on 64-bit Window http://bugs.python.org/issue27072 opened by Steven.Barker #27073: redundant checks in long_add and long_sub http://bugs.python.org/issue27073 opened by Oren Milman #27074: Confusing text about __all__ in __init__.py in tutorial http://bugs.python.org/issue27074 opened by ztane #27078: Make f'' strings faster than .format: BUILD_STRING opcode? http://bugs.python.org/issue27078 opened by ztane #27079: Bugs in curses.ascii predicates http://bugs.python.org/issue27079 opened by serhiy.storchaka #27080: Implement the formatting part of PEP 515, '_' in numeric liter http://bugs.python.org/issue27080 opened by eric.smith #27081: Multiprocessing is not robust against sys.stderr changes invol http://bugs.python.org/issue27081 opened by ppperry #27083: PYTHONCASEOK is ignored on Windows http://bugs.python.org/issue27083 opened by eryksun #27084: Add dir_fd and follow_symlinks kwargs to os.listdir and os.sca http://bugs.python.org/issue27084 opened by abacabadabacaba #27085: Make it possible to select return type for os.listdir http://bugs.python.org/issue27085 opened by abacabadabacaba #27086: Add closefd argument to os.listdir http://bugs.python.org/issue27086 opened by abacabadabacaba #27088: doc: select: epoll.poll: incorrect timeout units, missing maxe http://bugs.python.org/issue27088 opened by fordsfords #27095: Simplify MAKE_FUNCTION http://bugs.python.org/issue27095 opened by Demur Rumed #27099: IDLE: turn builting extensions into regular modules http://bugs.python.org/issue27099 opened by terry.reedy #27100: Attempting to use class with both __enter__ & __exit__ undefin http://bugs.python.org/issue27100 opened by ellingtonjp #27101: Compilation of python (modules) for foreign target platform pr http://bugs.python.org/issue27101 opened by complement #27103: regrtest: capture stdout (-W) option is incompatible with refl http://bugs.python.org/issue27103 opened by haypo #27105: cgi.__all__ is incomplete http://bugs.python.org/issue27105 opened by Unit03 #27106: configparser.__all__ is incomplete http://bugs.python.org/issue27106 opened by Unit03 #27107: mailbox.__all__ list is incomplete http://bugs.python.org/issue27107 opened by Unit03 #27108: mimetypes.__all__ list is incomplete http://bugs.python.org/issue27108 opened by Unit03 #27109: plistlib.__all__ list is incomplete http://bugs.python.org/issue27109 opened by Unit03 #27110: smtpd.__all__ list is incomplete http://bugs.python.org/issue27110 opened by Unit03 #27111: redundant variables in long_add and long_sub http://bugs.python.org/issue27111 opened by Oren Milman #27112: tokenize.__all__ list is incomplete http://bugs.python.org/issue27112 opened by Unit03 #27113: sqlite3 connect parameter "check_same_thread" not documented http://bugs.python.org/issue27113 opened by Dave Sawyer #27115: IDLE/tkinter: in simpledialog, <Return> != [OK] click http://bugs.python.org/issue27115 opened by terry.reedy #27117: turtledemo does not work with IDLE's new dark theme. http://bugs.python.org/issue27117 opened by terry.reedy #27119: `compile` doesn't compile into an AST object as specified http://bugs.python.org/issue27119 opened by leewz #27121: imghdr does not support jpg files with Lavc bytes http://bugs.python.org/issue27121 opened by René Løwe Jacobsen #27122: Hang with contextlib.ExitStack and subprocess.Popen (regressio http://bugs.python.org/issue27122 opened by Valentin David #27123: Allow `install_headers` command to follow specific directory s http://bugs.python.org/issue27123 opened by sylvain.corlay #27124: binascii.a2b_hex raises binascii.Error and ValueError, not Typ http://bugs.python.org/issue27124 opened by Lennart Grahl #27125: Typo in Python 2 multiprocessing documentation http://bugs.python.org/issue27125 opened by phx #27126: Apple-supplied libsqlite3 on OS X is not fork safe; can cause http://bugs.python.org/issue27126 opened by evan.jones(a)bluecore.com #27127: Never have GET_ITER not followed by FOR_ITER http://bugs.python.org/issue27127 opened by Demur Rumed #27128: Add _PyObject_FastCall() http://bugs.python.org/issue27128 opened by haypo #27129: Wordcode, part 2 http://bugs.python.org/issue27129 opened by serhiy.storchaka #27130: zlib: OverflowError while trying to compress 2^32 bytes or mor http://bugs.python.org/issue27130 opened by Klamann #27131: Unit test random shuffle http://bugs.python.org/issue27131 opened by jonathan.kross #27132: New assert method that checks an error message for a list of s http://bugs.python.org/issue27132 opened by maciej.szulik #27133: python 3.5.1 will not compile because libffi module uses wrong http://bugs.python.org/issue27133 opened by blastwave #27136: sock_connect fails for bluetooth (and probably others) http://bugs.python.org/issue27136 opened by pyptr2 Most recent 15 issues with no replies (15) ========================================== #27123: Allow `install_headers` command to follow specific directory s http://bugs.python.org/issue27123 #27121: imghdr does not support jpg files with Lavc bytes http://bugs.python.org/issue27121 #27117: turtledemo does not work with IDLE's new dark theme. http://bugs.python.org/issue27117 #27115: IDLE/tkinter: in simpledialog, <Return> != [OK] click http://bugs.python.org/issue27115 #27111: redundant variables in long_add and long_sub http://bugs.python.org/issue27111 #27109: plistlib.__all__ list is incomplete http://bugs.python.org/issue27109 #27103: regrtest: capture stdout (-W) option is incompatible with refl http://bugs.python.org/issue27103 #27088: doc: select: epoll.poll: incorrect timeout units, missing maxe http://bugs.python.org/issue27088 #27080: Implement the formatting part of PEP 515, '_' in numeric liter http://bugs.python.org/issue27080 #27079: Bugs in curses.ascii predicates http://bugs.python.org/issue27079 #27074: Confusing text about __all__ in __init__.py in tutorial http://bugs.python.org/issue27074 #27038: Make os.DirEntry exist http://bugs.python.org/issue27038 #27030: Remove deprecated re features http://bugs.python.org/issue27030 #27021: It is not documented that os.writev() suffer from SC_IOV_MAX http://bugs.python.org/issue27021 #27019: Reduce marshal stack depth for 2.7 on Windows debug build http://bugs.python.org/issue27019 Most recent 15 issues waiting for review (15) ============================================= #27136: sock_connect fails for bluetooth (and probably others) http://bugs.python.org/issue27136 #27131: Unit test random shuffle http://bugs.python.org/issue27131 #27129: Wordcode, part 2 http://bugs.python.org/issue27129 #27128: Add _PyObject_FastCall() http://bugs.python.org/issue27128 #27127: Never have GET_ITER not followed by FOR_ITER http://bugs.python.org/issue27127 #27125: Typo in Python 2 multiprocessing documentation http://bugs.python.org/issue27125 #27124: binascii.a2b_hex raises binascii.Error and ValueError, not Typ http://bugs.python.org/issue27124 #27113: sqlite3 connect parameter "check_same_thread" not documented http://bugs.python.org/issue27113 #27112: tokenize.__all__ list is incomplete http://bugs.python.org/issue27112 #27111: redundant variables in long_add and long_sub http://bugs.python.org/issue27111 #27110: smtpd.__all__ list is incomplete http://bugs.python.org/issue27110 #27109: plistlib.__all__ list is incomplete http://bugs.python.org/issue27109 #27108: mimetypes.__all__ list is incomplete http://bugs.python.org/issue27108 #27107: mailbox.__all__ list is incomplete http://bugs.python.org/issue27107 #27106: configparser.__all__ is incomplete http://bugs.python.org/issue27106 Top 10 most discussed issues (10) ================================= #26647: ceval: use Wordcode, 16-bit bytecode http://bugs.python.org/issue26647 23 msgs #27067: Improve curses tests http://bugs.python.org/issue27067 13 msgs #26632: __all__ decorator http://bugs.python.org/issue26632 9 msgs #27051: Create PIP gui http://bugs.python.org/issue27051 9 msgs #24225: Idlelib: changing file names http://bugs.python.org/issue24225 8 msgs #27122: Hang with contextlib.ExitStack and subprocess.Popen (regressio http://bugs.python.org/issue27122 8 msgs #27085: Make it possible to select return type for os.listdir http://bugs.python.org/issue27085 6 msgs #18373: let code force str(bytes) to raise an exception http://bugs.python.org/issue18373 5 msgs #27032: Remove deprecated html.parser.HTMLParser.unescape() http://bugs.python.org/issue27032 5 msgs #27072: random.getrandbits is limited to 2**31-1 bits on 64-bit Window http://bugs.python.org/issue27072 5 msgs Issues closed (41) ================== #5187: distutils upload should prompt for the user/password too http://bugs.python.org/issue5187 closed by berker.peksag #5784: raw deflate format and zlib module http://bugs.python.org/issue5784 closed by martin.panter #7159: Urllib2 authentication memory. http://bugs.python.org/issue7159 closed by terry.reedy #13615: setup.py register fails with -r argument http://bugs.python.org/issue13615 closed by berker.peksag #16509: sqlite3 docs do not explain check_same_thread http://bugs.python.org/issue16509 closed by berker.peksag #18383: test_warnings modifies warnings.filters when running with "-W http://bugs.python.org/issue18383 closed by martin.panter #23026: Winreg module doesn't support REG_QWORD, small DWORD doc updat http://bugs.python.org/issue23026 closed by python-dev #25823: Speed-up oparg decoding on little-endian machines http://bugs.python.org/issue25823 closed by serhiy.storchaka #26168: Py_BuildValue may leak 'N' arguments on PyTuple_New failure http://bugs.python.org/issue26168 closed by serhiy.storchaka #26306: Can't create abstract tuple http://bugs.python.org/issue26306 closed by r.david.murray #26742: imports in test_warnings changes warnings.filters http://bugs.python.org/issue26742 closed by martin.panter #26816: Make concurrent.futures.Executor an abc http://bugs.python.org/issue26816 closed by xiang.zhang #26877: tarfile use wrong code when read from fileobj http://bugs.python.org/issue26877 closed by mmarkk #27054: Python installation problem: No module named 'encodings' http://bugs.python.org/issue27054 closed by steve.dower #27060: Documentation of assertItemsEqual in unittest is VERY misleadi http://bugs.python.org/issue27060 closed by terry.reedy #27063: Some unittest loader tests are silently skipped by mistake http://bugs.python.org/issue27063 closed by serhiy.storchaka #27064: Make py.exe default to Python 3 when used interactively http://bugs.python.org/issue27064 closed by paul.moore #27070: Add ability to freeze (seal) mutable objects http://bugs.python.org/issue27070 closed by eric.smith #27071: unittest.TestCase.assertCountEqual is a very misleading name http://bugs.python.org/issue27071 closed by r.david.murray #27075: Link to StreamReader/Writer from codecs.getreader/writer http://bugs.python.org/issue27075 closed by berker.peksag #27076: Doc and comment spelling fixes http://bugs.python.org/issue27076 closed by martin.panter #27077: test_port_parameter_types fails with BytesWarning http://bugs.python.org/issue27077 closed by berker.peksag #27082: IDLE seriously degrades during and after printing large single http://bugs.python.org/issue27082 closed by terry.reedy #27087: unable to use socket send and sendall due to type error http://bugs.python.org/issue27087 closed by eric.smith #27089: I think this is a small bug in urlparse.py http://bugs.python.org/issue27089 closed by berker.peksag #27090: Python 3 import error after installation http://bugs.python.org/issue27090 closed by zach.ware #27091: Python IDLE doesn't like 💙 http://bugs.python.org/issue27091 closed by eryksun #27092: ord() raises TypeError on string/bytes input http://bugs.python.org/issue27092 closed by cwr #27093: Silence warning in cjkcodecs.h http://bugs.python.org/issue27093 closed by python-dev #27094: Floating Point Printing Error with 2+.8553 or 3+.8553 http://bugs.python.org/issue27094 closed by r.david.murray #27096: Ability to get random bytes from random.Random (as with os.ura http://bugs.python.org/issue27096 closed by rhettinger #27097: ceval: Wordcode follow up, explicit unsigned short read http://bugs.python.org/issue27097 closed by serhiy.storchaka #27098: Pickle of memoryview not raising error http://bugs.python.org/issue27098 closed by serhiy.storchaka #27102: Spam http://bugs.python.org/issue27102 closed by zach.ware #27104: enable-framework http://bugs.python.org/issue27104 closed by alexandra.beebe(a)gmail.com #27114: SSLContext._load_windows_store_certs fails with PermissionErro http://bugs.python.org/issue27114 closed by steve.dower #27116: Documentation for regular expression alphanumeric matching are http://bugs.python.org/issue27116 closed by zach.ware #27118: Several Py_XDE/INCREFs in typeobject.c are not necessary http://bugs.python.org/issue27118 closed by serhiy.storchaka #27120: xmllib unable to parse in UTF8 format http://bugs.python.org/issue27120 closed by serhiy.storchaka #27134: allow str(bytes) raises an exception to be controlled programm http://bugs.python.org/issue27134 closed by dholth #27135: nested list produced with multiplication is linked to the same http://bugs.python.org/issue27135 closed by benjamin.peterson 1 0 runtime dlls on Windows
by Chris Barker May 27, 2016

May 27, 2016 Hi folks, The standard build of Py3.5 for Windows is built with VS2015 (correct??) And it includes the runtime dlls it needs. However, we've found that wxPython wheels for win32 (not sure about win64) also need: MSVCP140.DLL So: wxPython could include that of course, But it looks like it's getting included with the Matplotlib wheels already (so folks with Matplotlib can run wx....). I'm just guessing, but this looks like the standard run time for C++ with that compiler. Python itself doesn't use C++, of course, but maybe we should include that dll with Python anyway -- that way folks can build wheels of packages with C++ extensions in the normal way, and those wheels will "just work", and we don't have to have every individual package ship the same dll. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker(a)noaa.gov 10 18