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

2015-03-07 Thread Ryan Stuart
Hi, On Sun, 8 Mar 2015 at 12:33 Ben Hoyt wrote: > 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 -- it compares the built-in os.walk() > implemented with os.listdir() with a version of walk() i

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

2015-03-07 Thread Victor Stinner
2015-03-08 3:31 GMT+01:00 Ben Hoyt : > Thanks for committing this, Victor! And fixing the d_type issue on funky > platforms. You're welcome. > Note that the actual CPython version of os.walk() doesn't yet use > os.scandir(). I intend to open a separate issue for that shortly (or Victor > can). Bu

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

2015-03-07 Thread Ben Hoyt
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 -- it compares the built-in os.walk() implemented with os.listdir()

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

2015-03-07 Thread Victor Stinner
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). Please test this new feature. You may benchmark here. http://bugs.python.org/issue22524 contains some benchmark tools and benchmark r

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

2015-03-07 Thread Brett Cannon
On Sat, Mar 7, 2015 at 12:39 PM Scott Dial wrote: > On 2015-03-06 11:34 AM, Brett Cannon wrote: > > This PEP proposes eliminating the concept of PYO files from Python. > > To continue the support of the separation of bytecode files based on > > their optimization level, this PEP proposes extendin

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

2015-03-07 Thread nha pham
This describes an optimization for "binary insertion sort" (BINSORT for short). BINSORT has been implemented in Python, CyThon, and Timsort (the default Array.sort() in JAVA SE 7 and JAVA SE 8) I have read the BINSORT in Timsort http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openj

[Python-Dev] Asking for review for Windows issues 21518 and 22080

2015-03-07 Thread Claudiu Popa
Hello, The winreg module has a function for loading a registry key under another registry key, called winreg.LoadKey. Unfortunately, the module doesn't provide a way to unload that key after the user finishes operating with it. There's a patch [1] for exporting the RegUnloadKey [2] API in winreg

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

2015-03-07 Thread Scott Dial
On 2015-03-06 11:34 AM, Brett Cannon wrote: > This PEP proposes eliminating the concept of PYO files from Python. > To continue the support of the separation of bytecode files based on > their optimization level, this PEP proposes extending the PYC file > name to include the optimization level in b

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

2015-03-07 Thread Brett Cannon
On Sat, Mar 7, 2015 at 9:29 AM Ron Adam wrote: > > > On 03/07/2015 04:58 AM, Steven D'Aprano wrote: > > On Fri, Mar 06, 2015 at 08:00:20PM -0500, Ron Adam wrote: > > > >> >Have you considered doing this by having different magic numbers in the > >> >.pyc file for standard, -O, and -O0 compiled by

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

2015-03-07 Thread Ron Adam
On 03/07/2015 04:58 AM, Steven D'Aprano wrote: On Fri, Mar 06, 2015 at 08:00:20PM -0500, Ron Adam wrote: >Have you considered doing this by having different magic numbers in the >.pyc file for standard, -O, and -O0 compiled bytecode files? Python >already checks that number and recompiles th

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

2015-03-07 Thread Steven D'Aprano
On Fri, Mar 06, 2015 at 08:00:20PM -0500, Ron Adam wrote: > Have you considered doing this by having different magic numbers in the > .pyc file for standard, -O, and -O0 compiled bytecode files? Python > already checks that number and recompiles the files if it's not what it's > expected to be