Re: [Python-Dev] PEP 448 review

2015-03-08 Thread Neil Girdhar
Anyone have time to do a code review? http://bugs.python.org/issue2292 On Mon, Mar 2, 2015 at 4:54 PM, Neil Girdhar mistersh...@gmail.com wrote: It's from five days ago. I asked Joshua to take a look at something, but I guess he is busy. Best, Neil — The latest file there is from Feb

Re: [Python-Dev] PEP 471 Final: os.scandir() merged into Python 3.5

2015-03-08 Thread Tim Delaney
On 8 March 2015 at 13:31, Ben Hoyt benh...@gmail.com wrote: Thanks for committing this, Victor! And fixing the d_type issue on funky platforms. Others: if you want to benchmark this, the simplest way is to use my os.walk() benchmark.py test program here: https://github.com/benhoyt/scandir

[Python-Dev] Tunning binary insertion sort algorithm in Timsort.

2015-03-08 Thread nha pham
We can optimize the TimSort algorithm by optimizing its binary insertion sort. The current version of binary insertion sort use this idea: Use binary search to find a final position in sorted list for a new element X. Then insert X to that location. I suggest another idea: Use binary

[Python-Dev] boxing and unboxing data types

2015-03-08 Thread Ethan Furman
When data is passed from Python to a native library (such as in an O/S call), how does the unboxing of data types occur? For a specific instance, os.open allows an integer whose various bits express desired behavior as `flags` -- if flags is 1, for example, the file is open write-only. If I

Re: [Python-Dev] boxing and unboxing data types

2015-03-08 Thread Steven D'Aprano
On Sun, Mar 08, 2015 at 08:31:30PM -0700, Ethan Furman wrote: When data is passed from Python to a native library (such as in an O/S call), how does the unboxing of data types occur? [...] So the real question: anywhere in Python where an int is expected (for lower-level API work), but not

Re: [Python-Dev] boxing and unboxing data types

2015-03-08 Thread Nathaniel Smith
On Mar 8, 2015 9:13 PM, Steven D'Aprano st...@pearwood.info wrote: There's no built-in way of calling __index__ that I know of (no equivalent to int(obj)), There's operator.index(obj), at least. but slicing at the very least will call it, e.g. seq[a:] will call type(a).__index__. -n

Re: [Python-Dev] boxing and unboxing data types

2015-03-08 Thread Ethan Furman
On 03/08/2015 09:12 PM, Steven D'Aprano wrote: Does that answer your questions? No, unfortunately. You correctly guessed my question is motivated by the IntFlag discussion. I guess it could boil down to: if IntEnum was not based on 'int', but instead had the __int__ and __index__ methods

Re: [Python-Dev] PEP 488: elimination of PYO files

2015-03-08 Thread Barry Warsaw
On Mar 07, 2015, at 12:30 PM, Scott Dial wrote: As a packager, this PEP is a bit silent on it's expectations about what will happen with (for instance) Debian and Fedora packages for Python. My familiarity is with Fedora, and on that platform, we ship .pyc and .pyo files (using -O for the .pyo).

Re: [Python-Dev] PEP 471 Final: os.scandir() merged into Python 3.5

2015-03-08 Thread Paul Moore
On 8 March 2015 at 02:13, Victor Stinner victor.stin...@gmail.com wrote: FYI I commited the implementation of os.scandir() written by Ben Hoyt. I hope that it will be part of Python 3.5 alpha 2 (Ben just sent the final patch today). Yay! Great news. Paul

Re: [Python-Dev] Request for Pronouncement: PEP 441 - Improving Python ZIP Application Support

2015-03-08 Thread Paul Moore
On 26 February 2015 at 21:48, Paul Moore p.f.mo...@gmail.com wrote: On 26 February 2015 at 21:34, Guido van Rossum gu...@python.org wrote: Accepted! Thanks for your patience, Paul, and thanks everyone for their feedback. I know there are still a few small edits to the PEP, but those don't

Re: [Python-Dev] PEP 488: elimination of PYO files

2015-03-08 Thread Nick Coghlan
For the record here: +1 on the PEP from me (the comments I made on import-sig have already incorporated into this version of the PEP) On 8 March 2015 at 08:03, Brett Cannon br...@python.org wrote: On Sat, Mar 7, 2015 at 12:39 PM Scott Dial scott+python-...@scottdial.com wrote: On 2015-03-06

Re: [Python-Dev] PEP 471 Final: os.scandir() merged into Python 3.5

2015-03-08 Thread Nick Coghlan
On 8 March 2015 at 12:13, Victor Stinner victor.stin...@gmail.com wrote: Hi, FYI I commited the implementation of os.scandir() written by Ben Hoyt. I hope that it will be part of Python 3.5 alpha 2 (Ben just sent the final patch today). Thanks to everyone that worked on getting this PEP

Re: [Python-Dev] Request for Pronouncement: PEP 441 - Improving Python ZIP Application Support

2015-03-08 Thread Brett Cannon
On Sun, Mar 8, 2015, 08:40 Paul Moore p.f.mo...@gmail.com wrote: On 26 February 2015 at 21:48, Paul Moore p.f.mo...@gmail.com wrote: On 26 February 2015 at 21:34, Guido van Rossum gu...@python.org wrote: Accepted! Thanks for your patience, Paul, and thanks everyone for their feedback. I