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.
...data and to also hold sequences of raw bytes which have no reasonable interpretation as displayable character sequences. This overlap hasn't been a big problem in the past, but as Python moves closer to requiring source code to be properly encoded, the use of strings to represent raw byte sequences will be more problematic. In addition, as Python's Unicode support has improved, it's easier to consider strings as ASCII-encoded Unicode objects. Proposed Implementation The number in parentheses...
...database tables as classes, like the one the Django framework ships. Django currently uses an ugly hack to restore the ordering of members in database models. The RawConfigParser class accepts a dict_type argument that allows an application to set the type of dictionary used internally. The motivation for this addition was expressly to allow users to provide an ordered dictionary. [1] Code ported from other programming languages such as PHP often depends on an ordered dict. Having an implemen...
...big fan of Monty Python's Flying Circus). Today, I can safely say that Python has changed my life. I have moved to a different continent. I spend my working days developing large systems in Python, when I'm not hacking on Python or answering Python-related email. There are Python T-shirts, workshops, mailing lists, a newsgroup, and now a book. Frankly, my only unfulfilled wish is to have my picture on the front page of the New York Times. But before I get carried away daydreaming...
...data = read(size) i = 0 while 1: try: object, decodedbytes = decode(data) except ValueError,why: # This method is slow but should work under pretty # much all conditions; at most 10 tries are made i = i + 1 newdata = read(1) if not newdata or i > 10: raise data = data + newdata else: return objec...
...data (normal C stack usage) with Python data (the state of the interpreted program) on the stack, the two are logically separate. They just happen to use the same stack. A real thread gets something approaching a process-sized stack because the implementation has no way of knowing how much stack space the thread will require. The stack space required for an individual frame is likely to be reasonable, but stack switching is an arcane and non-portable process, not supported by C. Once Python stop...
...data in memory unless: - The data exceeds some size, or - Somebody asks for a fileno. Then the cgi module (and other apps) could use this thing in a uniform way. https://bugs.python.org/issue415692 Jim Fulton pointed out that binascii's b2a_base64() function has situations where it makes sense not to append a newline, or to append something else than a newline. Proposal: add an optional argument giving the delimiter string to be appended, defaulting to "\n" possibly special-case None as th...
...data = reader.recv() while data: obj = marshal.loads(data) do_something(obj) data = reader.recv() """)) t = threading.Thread(target=run) t.start() for obj in input: data = marshal.dumps(obj) s.send(data) s.send(None) Passing objects via pickle interp = interpreters.create() r, s = interpreters.create_channel() interp.run(tw.dedent(""" import pickle """), shared=dict( reader=r, ), ) def run(): inte...
...data as possible is retained, and (b) all metadata is converted to formats that are common in Mercurial. This way, tools written for Mercurial can be optimally used. In order to do this, we want to use the hgsubversion software to do an initial conversion. This hg extension is focused on providing high-quality conversion from Subversion to Mercurial for use in two-way correspondence, meaning it doesn't throw away as much available metadata as other solutions. Such a conversion also seems like...
...datatype, the Unicode string, a new build-in function unicode(), an numerous C APIs to deal with Unicode and encodings. See the file Misc/unicode.txt for details, or http://starship.python.net/crew/lemburg/unicode-proposal.txt. Two other big changes, related to the Unicode support, are the addition of string methods and a new regular expression engine: String methods mean that you can now say s.lower() etc. instead of importing the string module and saying string.lower(s) etc. ...
...data type is needed and why other numeric data types are not enough. I wanted a Money data type, and after proposing a pre-PEP in comp.lang.python, the community agreed to have a numeric data type with the needed arithmetic behaviour, and then build Money over it: all the considerations about quantity of digits after the decimal point, rounding, etc., will be handled through Money. It is not the purpose of this PEP to have a data type that can be used as Money without further effort. One of the...
...data and nondata descriptors. The current implementation quite sensibly classifies member and getset descriptors as data (even if they are read-only!) and method descriptors as nondata. Non-descriptors (like function pointers or plain values) are also classified as non-data (!). This scheme has one drawback: in what I assume to be the most common case, referencing an instance variable stored in the instance dict, it does two dictionary lookups, whereas the classic scheme did a quick test for ...
...data in thread-local storage is absurdly quick, because modern platforms have put massive resources into optimizing this case (e.g. dedicating a CPU register for this purpose); calling a method on an event loop to fetch a handle to a namespace and then doing lookup in that namespace is much slower. More importantly, this extra cost would be paid on every access to the global data, even for programs which are not otherwise using an event loop at all. This PEP's proposal, by contrast, only affect...
...datatype, the Unicode string, a new build-in function unicode(), an numerous C APIs to deal with Unicode and encodings. See the file Misc/unicode.txt for details, or http://starship.python.net/crew/lemburg/unicode-proposal.txt. Two other big changes, related to the Unicode support, are the addition of string methods and a new regular expression engine: String methods mean that you can now say s.lower() etc. instead of importing the string module and saying string.lower(s) etc. One peculiarity...
...data will be copied into the array in Fortran-style (first dimension varies the fastest). If fortran is 'C', then the data will be copied into the array in C-style (last dimension varies the fastest). If fortran is 'A', then it does not matter and the copy will be made in whatever way is more efficient. int PyObject_CopyData(PyObject *dest, PyObject *src) These last three C-API calls allow a standard way of getting data in and out of Python objects into contiguous memory areas no matter how ...
...big part of this proposal and someone who tends more to ideology rather than practicality may be opposed to this PEP on that grounds alone. It is this PEPs belief that while using entirely Free/Open Source software is an attractive idea and a noble goal, that valuing the time of the contributors by giving them good tooling that is well maintained and that they either already know or if they learn it they can apply to other projects is a more important concern than treating whether something is F...
...biguity in execution order. This might be referred to as concurrency-local or task-local storage. In this meaning of "task", there is no ambiguity in the order of execution of the code within one task. (This concept of a task is close to equivalent to a Task in asyncio, but not exactly.) In such concurrency-locals, it is possible to pass information down the call chain to callees without another code path interfering with the value in the background. Common to the above approaches is that they i...
...big technical change: the Stable ABI will be explicitly listed in a human-maintained “manifest” file. There have been efforts to collect such lists automatically, e.g. by scanning the symbols exported from Python. Such automation might seem easier to maintain than a handcrafted file, but has major issues: for example, the set exported symbols has platform-specific variations. Also, the cost of updating an explicit manifest is small compared to the overall work that should go into changing API th...
...data structures, and focusing on the elegant expression of programs. They proposed both a new language design and new terminology that deviated radically from what was (and still is) current amongst computer scientists and programmers. In fact, the single biggest reason why ABC didn't make as much of an impact as expected is probably that they deviated too much from current practice. The people who had access to the hardware that was needed to run ABC (initially it only ran on Unix syst...
...Big Query: https://packaging.python.org/guides/analyzing-pypi-package-downloads/ Accordingly, the mirroring proposal described in this PEP is no longer required, and has been marked as Withdrawn. Rationale PyPI is hosting over 6000 projects and is used on a daily basis by people to build applications. Especially systems like easy_install and zc.buildout make intensive usage of PyPI. For people making intensive use of PyPI, it can act as a single point of failure. People have started to set up...
...biguous. In a future release, the compiler may allow this form when there is no possibility of ambiguity. repr(string) is easier to read, now using hex escapes instead of octal, and using t, n and r instead of 011, 012 and 015 (respectively): >>> "\texample \r\n" + chr(0) + chr(255) '\texample \r\n\x00\xff' # in 2.1 '\011example \015\012\000\377' # in 2.0 Functions are now compared and hashed by identity, not by value, since the func_code attribute is writable. ...