[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor
STINNER Victor added the comment: > why was that only an issue on 2.7? I added PyMem_RawMalloc() to Python 3.4 and this function must be thread-safe. https://docs.python.org/dev/c-api/memory.html#raw-memory-interface "These functions are thread-safe, the GIL does not need to be held." I repl

[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Nathaniel Smith
Nathaniel Smith added the comment: Would it be more acceptable to use a DeprecationWarning? It's not really the right thing because we're not planning to ever actually remove the functionality. But, we've already gone to a lot of trouble to try to show DeprecationWarnings specifically to dev

[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: I don't think it is crazy for 2.7, but I'd move that to its own issue as you already nicely addressed the problem related to this PR without needing that. -- ___ Python tracker

[issue35368] [2.7] Make PyMem_Malloc() thread-safe in debug mode

2018-11-30 Thread STINNER Victor
New submission from STINNER Victor : While fixing bpo-33015, I discovered that PyMem_Malloc() isn't thread-safe when Python is compiled in debug mode: https://bugs.python.org/issue33015#msg330806 I wrote PR 10828 to make PyMem_Malloc() thread-safe when Python is compiled in debug mode. -

[issue35368] [2.7] Make PyMem_Malloc() thread-safe in debug mode

2018-11-30 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +10076 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: Given that linters like pylint can already detect the common case of this issue when using `is` and `is not` to compare to a literal where == or != seems more appropriate, I don't think a warning is very useful. In my experience people are more likely to r

[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor
STINNER Victor added the comment: > I don't think it is crazy for 2.7, but I'd move that to its own issue as you > already nicely addressed the problem related to this PR without needing that. Good idea. I created bpo-35368. I close this issue since it's now fixed. -- resolution: ->

[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks like we have a stand-off between core devs, and no BDFL to make a ruling. There is support for the feature from at least Barry and Raymond (although I think Guido was cool on the idea, maybe?). Gregory, do you feel strongly enough about this that you

[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm actually fine either way. Consider me a solid ±0 -- ___ Python tracker ___ ___ Python-bugs-l

[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Nathaniel Smith
Nathaniel Smith added the comment: > In my experience people are more likely to run code through a linter than > they are to ever run an interpreter with DeprecationWarning enabled. This used to be true, and it was a disaster. So there's been a lot of work to fix it, and it's not true anymor

[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread David Wyde
New submission from David Wyde : Python's Timsort sometimes makes the same comparison twice. This leads to extra compares, which can hurt performance. Python sorts several length-3 permutations in 4 steps, and the problem accumulates with bigger data. There are ~9,800 duplicate less-than chec

[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread David Wyde
Change by David Wyde : Added file: https://bugs.python.org/file47963/sort.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue35354] Generator functions stack overflow

2018-11-30 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Brett, the user had an invalid email address in their profile thus adding comments to the issue caused a server error while sending notification to them. So they have been removed from the issue. Please see : https://python.zulipchat.com/#narrow/st

[issue33130] functools.reduce signature uses `iterable`, documentation should use the same term

2018-11-30 Thread Ben Finney
Ben Finney added the comment: The library documentation (e.g. file:///usr/share/doc/python3/html/library/functools.html#functools.reduce ) also has this dissonance: > functools.reduce(`function`, `iterable` [, `initializer` ]) > >Apply function of two arguments cumulatively to the items

[issue33130] functools.reduce signature uses `iterable`, documentation should use the same term

2018-11-30 Thread Ben Finney
Ben Finney added the comment: Hah, sorry to use a local-filesystem URL. (Hooray for locally-installed developer documentation!) The same section is online at https://docs.python.org/3/library/functools.html#functools.reduce . -- ___ Python tracke

[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread Tim Peters
Tim Peters added the comment: Yup, it can do some redundant comparisons; more on that here: https://mail.python.org/pipermail/python-dev/2018-August/155020.html I'm not inclined to make this already-difficult code even harder to understand for something that's quite likely not to matter - or

<    1   2