[issue15275] isinstance is called a more times that needed in ntpath

2014-07-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue15275] isinstance is called a more times that needed in ntpath

2014-07-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset b22aaa59d24f by Serhiy Storchaka in branch 'default': Issue #15275: Clean up and speed up the ntpath module. http://hg.python.org/cpython/rev/b22aaa59d24f -- nosy: +python-dev ___ Python tracker

[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread STINNER Victor
STINNER Victor added the comment: Oh you're right sorry. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, if *path* is not bytes, *userhome* shouldn't be converted to bytes. -- ___ Python tracker ___

[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread STINNER Victor
STINNER Victor added the comment: I like ntpath_cleanup.diff, I don't think that it makes the code worse. FYI os.fsencode() accepts str too, you can simplify: if isinstance(path, bytes): -userhome = userhome.encode(sys.getfilesystemencoding()) +userhome = os.fsencode(userho

[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is alternative patch. I believe it makes a code simpler. Microbenchmarks: $ ./python -m timeit -n 10 -s "from ntpath import splitdrive" "splitdrive('c:foo')" Before: 10 loops, best of 3: 20 usec per loop After: 10 loops, best of 3: 11.5 us

[issue15275] isinstance is called a more times that needed in ntpath

2014-06-08 Thread Mark Lawrence
Mark Lawrence added the comment: @Manuel do you intend picking this up? -- nosy: +BreamoreBoy ___ Python tracker ___ ___ Python-bugs-l

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-25 Thread Ezio Melotti
Ezio Melotti added the comment: > I don't know about a decent way of doing benchmarks for the changes. > Any recommendation? You could make a script that uses the timeit module. >> If this patch is applied I think it would be good to change >> posixpath too. > I agree and I'd love to do it but

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-24 Thread Manuel de la Pena
Manuel de la Pena added the comment: Tests indeed cover the changes made. I don't know about a decent way of doing benchmarks for the changes. Any recommendation? > If this patch is applied I think it would be good to change posixpath too. I agree and I'd love to do it but in a diff bug to ma

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-13 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-13 Thread Ezio Melotti
Ezio Melotti added the comment: Have you tried doing some benchmarks before and after the patch? If this patch is applied I think it would be good to change posixpath too. Also make sure that the changes you made are covered by the tests. -- nosy: +ezio.melotti stage: -> patch review t

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-08 Thread Manuel de la Pena
Changes by Manuel de la Pena : -- nosy: +brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-07 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-07 Thread Manuel de la Pena
Changes by Manuel de la Pena : Removed file: http://bugs.python.org/file26295/f5c57ba1124b.diff ___ Python tracker ___ ___ Python-bugs-list ma

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-07 Thread Manuel de la Pena
Changes by Manuel de la Pena : Added file: http://bugs.python.org/file26295/f5c57ba1124b.diff ___ Python tracker ___ ___ Python-bugs-list mail

[issue15275] isinstance is called a more times that needed in ntpath

2012-07-07 Thread Manuel de la Pena
New submission from Manuel de la Pena : The problem is simple, the code that allows to use binary strings and unicode is making more calls that needed to isinstance(path, bytes) since the result of the code is not shared. For example, the following calls are present in the module: def _get_em