[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-04 Thread Eric Snow
Eric Snow added the comment: > For now, this proposal is on hold because > 1) it isn't clear that it should be done, > 2) it needs a lot of serious discussion before proceeding, > 3) it may be premature while the status of the regular dict > is still in flux. +1 When writing the C

[issue31140] Insufficient error message with incorrect formated string literal

2017-09-04 Thread Eric V. Smith
Changes by Eric V. Smith : -- versions: +Python 3.7 ___ Python tracker ___ ___

[issue31140] Insufficient error message with incorrect formated string literal

2017-09-04 Thread Eric V. Smith
Changes by Eric V. Smith : -- stage: -> needs patch ___ Python tracker ___ ___

[issue31281] fileinput inplace does not work with pathlib.Path

2017-09-04 Thread Eric V. Smith
Eric V. Smith added the comment: I did not backport this to 3.6, because it depends on other changes that themselves have not been backported. -- assignee: -> eric.smith resolution: -> fixed stage: -> resolved status: open -> closed versions: -Python 3.4, Python 3.5

[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- pull_requests: +3326 ___ Python tracker ___ ___

[issue31333] Implement ABCMeta in C

2017-09-04 Thread Eric Snow
Eric Snow added the comment: > This mostly influences the Python interpreter start-up time > (because of extensive use of ABCs in importlib) Just to be clear, the only ABCs in importlib are in importlib.abc (and used by importlib.util). This does not impact interpreter startup. --

[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nick Coghlan
Nick Coghlan added the comment: Greg Smith & I are looking at this at the core dev sprint, and we think some variant of the "atomic until" idea should work, but there's a prerequisite change to the way "async with" works: the "GET_AWAITABLE" opcodes need to be avoided in this case, as they

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Sep 4, 2017, at 10:18, Serhiy Storchaka wrote: > Serhiy Storchaka added the comment: > > Could you please also look at other asserts? I have counted 48 occurrences of > assert(0), 11 assert(0 && "message") and 2 assert(!"message").

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After adding PyErr_Clear() the benefit of this optimization is smaller. Only 8% on my 64-bit computer. And no any effect on 32-bit. I wounder if it is worth to complicate the code for such small benefit. For non-empty classes the relative benefit is even

[issue16988] argparse: PARSER option for nargs not documented

2017-09-04 Thread R. David Murray
R. David Murray added the comment: I don't think this use case is enough to justify documenting it, since this is not an intuitive meaning of the word PARSER. I think if we wanted to expose this for this kind of use case, we'd want to rename the constant (with an alias for backward

[issue31281] fileinput inplace does not work with pathlib.Path

2017-09-04 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 06de1aeff94e524bed21d188065c4cd1590fb046 by ericvsmith (Zhiming Wang) in branch 'master': bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208) https://github.com/python/cpython/commit/06de1aeff94e524bed21d188065c4cd1590fb046

[issue30541] Add restricted mocks to the python unittest mocking framework

2017-09-04 Thread STINNER Victor
STINNER Victor added the comment: I will merge the PR this week, the PR now LGTM. -- ___ Python tracker ___

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Stefan Krah
Stefan Krah added the comment: I'm very much in favor of using abort() /* NOT REACHED */ in such cases. The only drawback is that in the case of libraries, sometimes distribution package lint tools complain. -- nosy: +skrah ___ Python tracker

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please also look at other asserts? I have counted 48 occurrences of assert(0), 11 assert(0 && "message") and 2 assert(!"message"). If fix one occurrence, why not fix all others? -- ___ Python tracker

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread STINNER Victor
STINNER Victor added the comment: I would prefer to use the _Py_IDENTIFIER API rather than using _PyDict_GetItem_KnownHash(). -- ___ Python tracker ___

[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Sorry for the long delay. It looks like Ian's original link is no longer valid. Do you have an updated link to a possible doctest or example? -- ___ Python tracker

[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- versions: +Python 3.7 -Python 3.2 ___ Python tracker ___

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'll preface that it's not a major issue that I feel *has* to be fixed, but given that assert *can* be compiled away, does it make sense to use abort() instead? E.g. 1 file changed, 2 insertions(+), 2 deletions(-) Python/compile.c | 4 ++-- modified

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- pull_requests: +3325 ___ Python tracker ___ ___

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The default case is added just for silencing compiler warning. It is never executed. There are a number of places in the core that look like assert(0); return NULL; /* or whatever */ This is a dead code, but compilers complain without it. How do

[issue31328] _sha3 is missing from Setup.dist

2017-09-04 Thread Segev Finer
Changes by Segev Finer : -- pull_requests: +3324 ___ Python tracker ___ ___

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: As it's barely worth fixing, it's not worth backporting. -- ___ Python tracker ___

[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Barry A. Warsaw
New submission from Barry A. Warsaw: There is a very minor opportunity for NULL dereference in compile.c. compiler_subdict() does not check the return value of get_const_value(), which could be NULL. This was found by Kirit Sankar Gupta. This is not a security issue in practice, since

[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-04 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Stefan Behnel
Stefan Behnel added the comment: It's the slot names in "slotdefs". See "update_one_slot()". The time that is saved is mostly the overhead of calling PyDict_GetItem(). I actually tried PyDict_GetItemWithError() first, which is faster due to the lower error handling overhead, before I noticed

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What names are looked up when you create an empty class? I'm surprised that this change has measurable performance effect. Aren't name an interned string with precalculated cache? -- nosy: +haypo, inada.naoki, pitrou, rhettinger

[issue31329] Add idlelib module entry to doc

2017-09-04 Thread Louie Lu
Changes by Louie Lu : -- nosy: +louielu ___ Python tracker ___ ___ Python-bugs-list mailing

[issue31327] bug in dateutil\tz\tz.py

2017-09-04 Thread Louie Lu
Louie Lu added the comment: Using macOS and Linux can't reproduce this problem, both platform return this output: >>> import time >>> time.localtime(-3600) time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=7, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0) -- nosy:

[issue31331] IDLE: Move prompts with input.

2017-09-04 Thread Louie Lu
Louie Lu added the comment: Or the output should be: >>> from threading import Timer >>> Timer(0.1, lambda: print('hello'), ()).start() >>> 'hello' >>> -- ___ Python tracker

[issue31331] IDLE: Move prompts with input.

2017-09-04 Thread Louie Lu
Louie Lu added the comment: minimum reproduce: >>> from threading import Timer >>> Timer(0.1, lambda: print('hello'), ()).start() >>> 'hello' a = ( 12, --- And the expect output should be something like: >>> from threading import Timer >>> Timer(0.1, lambda:

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Stefan Behnel
Stefan Behnel added the comment: Comparing against CPython master as of 122e88a8354e3f75aeaf6211232dac88ac296d54 I rebuilt my CPython to get clean results, and that still gave me almost 15% overall speedup. Original: $ ./python -m timeit 'class Test: pass' 2 loops, best of 5: 9.55 usec

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Stefan Behnel
Stefan Behnel added the comment: I literally just ran timeit on "class Test: pass", but I'll see if I can provide proper numbers. -- ___ Python tracker

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide benchmarks that you used? -- nosy: +serhiy.storchaka stage: -> patch review ___ Python tracker

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Stefan Behnel
New submission from Stefan Behnel: The method lookup fast path in _PyType_Lookup() does not apply during type creation, which is highly dominated by the performance of the dict lookups along the mro chain. Pre-calculating the name hash speeds up the creation of an empty class (i.e. "class

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-04 Thread Stefan Behnel
Changes by Stefan Behnel : -- pull_requests: +3322 ___ Python tracker ___ ___

[issue31335] str.format should support "{:r}" for any type.

2017-09-04 Thread Alastair Houghton
Alastair Houghton added the comment: Having looked carefully through the current code, I notice that the error message *has* been improved (though it'd be nice if it included a copy of the format string it's rejecting), and also that the alternative "{!r}".format(None) does work as

[issue31335] str.format should support "{:r}" for any type.

2017-09-04 Thread Alastair Houghton
New submission from Alastair Houghton: Currently if you do "{:r}".format(None) you get the error message TypeError: non-empty format string passed to object.__format__ or on newer versions TypeError: non-empty format string passed to NoneType.__format__ (which is at least *some*

[issue31319] Rename idlelib to just idle

2017-09-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: Hi Éric. Adding idle.py would make -m idle work. But I believe it would violate existing policy. So I will not propose it on python-ideas or pydev and hope no one else does either. PEP 434, at least in part, formalized what I believe was older practice

[issue31320] test_ssl logs a traceback

2017-09-04 Thread Martin Panter
Martin Panter added the comment: Not sure if you just want to hide the presence of the exception and traceback. But regarding the exception itself (OSError with errno 0), this is not ideal. From memory, you tend to get this when the connection is shut down insecurely at the TCP level. A

<    1   2