Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
...parallelism. Among other things, the GIL currently protects against races between multiple concurrent threads that may incref or decref the same object. Without a shared GIL, two running interpreters could not safely share any objects, even otherwise immutable ones like None. This means that, to have a per-interpreter GIL, each interpreter must have its own copy of every object. That includes the singletons and static types. We have a viable strategy for that but it will require a meaningful a...
...parallel; over time, this compatibility should be phased out. The distinction between narrow and wide Unicode builds is dropped. An implementation of this PEP is available at [1]. Rationale There are two classes of complaints about the current implementation of the unicode type: on systems only supporting UTF-16, users complain that non-BMP characters are not properly supported. On systems using UCS-4 internally (and also sometimes on systems using UCS-2), there is a complaint that Unicode st...
...parallel execution. In many cases the pyprocessing package is even faster than the normal threading approach for I/O bound programs. This of course, takes into account that the pyprocessing package is in optimized C code, while the threading module is not. The "Distributed" Problem In the discussion on Python-Dev about the inclusion of this package [3] there was confusion about the intentions this PEP with an attempt to solve the "Distributed" problem - frequently comparing the functionality ...
...parallel between the raise and except statements strongly suggests that raised and caught refer to the same object. For string exceptions this actually is the case, but for instance exceptions it is not. When instantiation is implicit, it is not obvious when it occurs, for example, whether it occurs when the exception is raised or when it is caught. Since it actually happens at the raise, the code should say so. (Note that at the level of the C API, an exception can be "raised" and "caught" w...
...parallel. It's fine for this to be a builtin. I don't like the name "indexed"; adjectives do not make good function names. Maybe iterindexed()? I don't like the start and stop arguments. If I saw code like for i, j in iterindexed("abcdefghij", 5, 10): print i, j I would expect it to print 5 f 6 g 7 h 8 i 9 j while the spec in the PEP would print 5 a 6 b 7 c 8 d 9 e Very confusing. I prop...
...parallel to svn.python.org. The working repo might live at http://hg.python.org/cpython/, for example, with the archive repo at http://hg.python.org/cpython-archive/. For write access, developers will have to use ssh, which could be ssh://hg@hg.python.org/cpython/. code.python.org was also proposed as the hostname. We think that using the VCS name in the hostname is good because it prevents confusion: it should be clear that you can't use svn or bzr for hg.python.org. hgwebdir can already pro...
...parallel, or those that depend on other steps. We use the following conventions in the examples below. Where a release number is given, it is of the form X.Y.MaA, e.g. 2.1.2c1 for Python 2.1.2 release candidate 1, where "a" == alpha, "b" == beta, "c" == release candidate. Final releases are tagged with "releaseXYZ" in CVS. The micro releases are made from the maintenance branch of the major release, e.g. Python 2.1.2 is made from the release21-maint branch. Send an email to python-dev@python...
...parallel with the "Python" word mark. J. Rush noted that this will cost about $50,000 worldwide. S. Holden confirmed. A. Kuchling: "I'm nervous about the expense, though; is that amount justifiable in a time of uncertain sponsorship and PyCon losses?" S. Holden noted that it's a one-time expense. D. Goodger thought it was overdue. T. Peters noted that it "probably won't get cheaper over time". A. Kuchling: "Could we reduce the country coverage, and register ...
...parallel maintenance and development of the various CPython releases, it's a good fit for several of the ancillary projects that surround CPython that we don't wish to move to a proprietary hosting site. The key requirements proposed for a PSF provided software forge are: MUST support simple "pull request" style workflows MUST support online editing for simple changes MUST be backed by an active development organisation (community or commercial) MUST support self-hosting of the master repositor...
...parallel, in practice, the needs of different projects and developer communities have proven to be sufficiently diverse that a variety of approaches have been devised, allowing each group to select an approach that best fits their needs. Lennart Regebro has produced an excellent overview of the available migration strategies [2], and a similar review is provided in the official porting guide [3]. (Note that the official guidance has softened to "it depends on your specific situation" since Lenna...
...parallel to **kwargs. The new syntax, ***kwargs (note that there are three asterisks), would indicate that kwargs should preserve the order of keyword arguments. Prognosis: New syntax is only added to Python under the most dire circumstances. With other available solutions, new syntax is not justifiable. Furthermore, like all opt-in solutions, the new syntax would complicate the pass-through case. annotations This is a variation on the decorator approach. Instead of using a decorator to mark...
...parallel threads. A somewhat less naive option is to store the information as per-thread information in thread-local storage, where each thread has its own "copy" of the variable which other threads cannot interfere with. Although non-ideal, this has been the best solution in many cases. However, thanks to generators and coroutines, the execution of the call chain can be suspended and resumed, allowing code in other contexts to run concurrently. Therefore, using thread-local storage is concurren...
...parallel, managing “sub-interpreters” using Py_NewInterpreter/Py_EndInterpreter. Both cases (and combinations of them) would be most useful when embedding Python within a library. Libraries generally shouldn't make assumptions about the application that uses them, which includes assumptions about a process-wide “main Python interpreter”. Currently, CPython doesn't handle this use case well. Many extension modules (and even some stdlib modules) use per-process global state, because C static vari...
...parallel" # t.run() Reference Implementation A prototype patch implementing all of the features described in this PEP is available as SourceForge patch #1223381 (https://bugs.python.org/issue1223381). This patch was committed to CVS 01-02 August 2005. Acknowledgements Raymond Hettinger (PEP 288) and Samuele Pedroni (PEP 325) first formally proposed the ideas of communicating values or exceptions into generators, and the ability to close generators. Timothy Delaney suggested the title of ...
...parallel threads can use it safely. sys.get_asyncgen_hooks() returns a namedtuple-like structure with firstiter and finalizer fields. asyncio The asyncio event loop will use sys.set_asyncgen_hooks() API to maintain a weak set of all scheduled asynchronous generators, and to schedule their aclose() coroutine methods when it is time for generators to be GCed. To make sure that asyncio programs can finalize all scheduled asynchronous generators reliably, we propose to add a new event loop corouti...
...Parallel -- Using IPython for parallel computing https://ipyparallel.readthedocs.io/ [4]PyArrow -- A cross-language development platform for in-memory data https://arrow.apache.org/docs/python/ [5]PyArrow IPC and component-based serialization https://arrow.apache.org/docs/python/ipc.html#component-based-serialization [6]pickle5 branch on GitHub https://github.com/pitrou/cpython/tree/pickle5 [7]PEP 574 Pull Request on GitHub https://github.com/python/cpython/pull/7076 [8]...
...parallel for CPython, PyPy, and GraalVM Python. HPy is still evolving very fast. Issues are still being solved while migrating NumPy, and work has begun on adding support for HPy to Cython. Work on pybind11 is starting soon. Tim Felgentreff believes by the time HPy has these users of the existing C API working, HPy should be in a state where it is generally useful and can be deemed stable enough that further development can follow a more stable process. In the long run the HPy project would like...
...parallel. Existing tools won't abide by this guideline until they're updated to support the new metadata standard, so the new semantics will first take effect for a hypothetical 2.x -> 3.0 transition. For the 1.x -> 2.x transition, we will use the approach where tools continue to produce the existing supplementary files (such as entry_points.txt) in addition to any equivalents specified using the new features of the standard metadata format (including the formal extension mechanism). Swi...
...parallels to __new__ and __init__ of classes. Extension modules can safely store arbitrary C-level per-module state in the module that is covered by normal garbage collection and supports reloading and sub-interpreters. Extension authors are encouraged to take these issues into account when using the new API. The proposal also allows extension modules with non-ASCII names. Not all problems tackled in PEP 3121 are solved in this proposal. In particular, problems with run-time module lookup (PySta...
...parallel the syntax variants supported by typing.NamedTuple. Other proposed features include TypedDict inheritance and totality (specifying whether keys are required or not). This PEP also provides a sketch of how a type checker is expected to support type checking operations involving TypedDict objects. Similar to PEP 484, this discussion is left somewhat vague on purpose, to allow experimentation with a wide variety of different type checking approaches. In particular, type compatibility sho...