Re: Increasing the diversity of people who write Python (was: Benefits of unicode identifiers)

2017-11-23 Thread Thomas Jollans
On 24/11/17 05:45, Andrew Z wrote: > I have hard time seeing the benefits of this "necessity" , just > unreasonable overcomplications for the name of "diversity". What complications? -- https://mail.python.org/mailman/listinfo/python-list

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 2:52 PM, Mikhail V wrote: > On Fri, Nov 24, 2017 at 4:13 AM, Chris Angelico wrote: >> On Fri, Nov 24, 2017 at 1:44 PM, Mikhail V wrote: >>> From my above example, you could probably see that I prefer somewhat

[issue32122] Improve -x option documentation

2017-11-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The documentation of the -x option is virtually not existing. The current short line of the description was enough to me for understanding what is the purpose of this option and how it can be used (I didn't use Windows for

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I prefer to keep the current code as is. -- ___ Python tracker ___

Re: Increasing the diversity of people who write Python (was: Benefits of unicode identifiers)

2017-11-23 Thread Andrew Z
I have hard time seeing the benefits of this "necessity" , just unreasonable overcomplications for the name of "diversity". On Nov 23, 2017 22:57, "Ben Finney" wrote: > Ian Kelly writes: > > > On Thu, Nov 23, 2017 at 1:04 PM, Karsten

Increasing the diversity of people who write Python (was: Benefits of unicode identifiers)

2017-11-23 Thread Ben Finney
Ian Kelly writes: > On Thu, Nov 23, 2017 at 1:04 PM, Karsten Hilbert > wrote: > > Using function arguments written in Thai script ? > > > > Understanding, let alone being able to read, code written in Arabic > > ? > > People are going to write

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Mikhail V
On Fri, Nov 24, 2017 at 4:13 AM, Chris Angelico wrote: > On Fri, Nov 24, 2017 at 1:44 PM, Mikhail V wrote: >> From my above example, you could probably see that I prefer somewhat >> middle-sized identifiers, one-two syllables. And naturally, they tend to

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 1:44 PM, Mikhail V wrote: > From my above example, you could probably see that I prefer somewhat > middle-sized identifiers, one-two syllables. And naturally, they tend to > reflect some process/meaining, it is not always achievable, > but yes there

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Mikhail V
On Thu, Nov 23, 2017 at 10:05 PM, Chris Angelico wrote: > On Fri, Nov 24, 2017 at 8:02 AM, Mikhail V wrote: >> On Thu, Nov 23, 2017 at 9:39 PM, Chris Angelico wrote: >>> On Fri, Nov 24, 2017 at 7:38 AM, Mikhail V

[issue29512] regrtest refleak: implement bisection feature

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Python 2.7.14 was released with test.bisect. While there are corner cases, do we really have to do something? The simplest fix is just to rename Lib/test/bisect.py to Lib/test/bisect_cmd.py in Python 2.7. It's a tool written for

[issue30657] Unsafe arithmetic in PyString_DecodeEscape

2017-11-23 Thread Larry Hastings
Larry Hastings added the comment: I would welcome a backport of this for 3.5 and even 3.4 (if it's vulnerable, which it probably is). -- ___ Python tracker

[issue27068] Add a detach() method to subprocess.Popen

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Sorry, but I'm not sure that it's a good idea to add a detach() method. It's hard to follow who owns all resources attached to a process, not only it's pid, but also streams which may be buffered. I propose the close the issue. The

[issue23719] PEP 475: port test_eintr to Windows

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I lost track of this idea, and I was unable to review win32-sleep-test.diff :-( While it would be "nice to have", the code is well tested on Unix. I close the issue. -- resolution: -> out of date stage: -> resolved

[issue31805] support._is_gui_available() hangs on x86-64 Sierra 3.6/3.x buildbot

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: The issue is gone. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue31520] ResourceWarning: unclosed warning

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: I'm not confortable to expose the value of the private _io_refs attribute in repr(socket.socket). I'm not sure that anything should really be done here. I close the issue. -- resolution: -> out of date stage: -> resolved

[issue31911] Use malloc_usable_size() in pymalloc for realloc

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: I agree. I don't think that it's worth it to overcompilates the API. I proposed this change since we may change the API to add PyMem_AlignedAlloc(). Since I just rejected bpo-18835, it's no more the case. I close this issue as

[issue32050] Fix -x option documentation

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: The initial proposition was to *deprecate* the option. In the meanwhile, I removed an outdated note. While the documentation is not perfect, I don't feel confortable to fix it, so I left it unchanged. I close this PR. Please open a

[issue32089] In developer mode (-X dev), ResourceWarning is only emited once per line numbers

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Antoine: What do you think of using the "default" action for pydebug build and -X dev? -- ___ Python tracker

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: I added a Py_FatalError() to Python 2.7 if the case that must not happen does happen. Are you ok to apply the same change for Python 3.6 (commit ed4743a2f2bb8d88f7f1aa9307794be9a44f1e0f), or do you prefer to backport your

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset ed4743a2f2bb8d88f7f1aa9307794be9a44f1e0f by Victor Stinner in branch '2.7': bpo-31626: Fix _PyObject_DebugReallocApi() (#4310) https://github.com/python/cpython/commit/ed4743a2f2bb8d88f7f1aa9307794be9a44f1e0f

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: It seems like these specific descriptors are rare, so the added complexity is not worth it. I close my issue as rejected. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed

[issue18835] Add PyMem_AlignedAlloc()

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: Because of the lack of strong motivition compared to the size of the change and the cost to maintain it, I reject this issue. For the archives, I attach a copy of the latest version of my implementation. -- resolution: ->

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Ian Kelly
On Thu, Nov 23, 2017 at 2:19 PM, Richard Damon wrote: > The Unicode Standard provides a fairly good classification of the > characters, and it would make sense to define that an character that is > defined as a 'Letter' or a 'Number', and some classes of Punctuation >

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Ian Kelly
On Thu, Nov 23, 2017 at 1:04 PM, Karsten Hilbert wrote: > On Thu, Nov 23, 2017 at 08:46:01PM +0100, Thomas Jollans wrote: > >> > I mean for a real practical situation - for example for an average >> > Python programmer or someone who seeks a programmer job. >> > And who

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread Jesse Bakker
Jesse Bakker added the comment: I can work on this if you want. Can have a PR ready in a few minutes. -- nosy: +Jesse Bakker ___ Python tracker

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread Jesse Bakker
Change by Jesse Bakker : -- keywords: +patch pull_requests: +4470 stage: needs patch -> patch review ___ Python tracker ___

[issue31325] req_rate is a namedtuple type rather than instance

2017-11-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31325] req_rate is a namedtuple type rather than instance

2017-11-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset ff847d1ac7e6a8ee1fb6f8883cfb4aec4b4a9b03 by Raymond Hettinger (Miss Islington (bot)) in branch '3.6': bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (GH-4529) (#4533)

[issue31325] req_rate is a namedtuple type rather than instance

2017-11-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 3df02dbc8e197053105f9dffeae40b04ec66766e by Raymond Hettinger (Berker Peksag) in branch 'master': bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529)

[issue31325] req_rate is a namedtuple type rather than instance

2017-11-23 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4469 ___ Python tracker ___

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Thomas Jollans
On 24/11/17 00:18, Richard Damon wrote: > On 11/23/17 5:45 PM, Thomas Jollans wrote: >> On 23/11/17 23:15, Richard Damon wrote: >>> My thought is you define a legal only those Unicode characters that via >>> the defined classification would be normally legal, but perhaps the >>> first

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Richard Damon
On 11/23/17 5:45 PM, Thomas Jollans wrote: On 23/11/17 23:15, Richard Damon wrote: My thought is you define a legal only those Unicode characters that via the defined classification would be normally legal, but perhaps the first implementation doesn't diagnose many of the illegal combinations.

[issue32096] Py_DecodeLocale() fails if used before the runtime is initialized.

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4467 ___ Python tracker ___ ___

[issue30860] Consolidate stateful C globals under a single struct.

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4468 ___ Python tracker ___ ___

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Thomas Jollans
On 23/11/17 23:15, Richard Damon wrote: > > My thought is you define a legal only those Unicode characters that via > the defined classification would be normally legal, but perhaps the > first implementation doesn't diagnose many of the illegal combinations. > If that isn't Pythonic, then yes,

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Richard Damon
On 11/23/17 4:31 PM, Chris Angelico wrote: On Fri, Nov 24, 2017 at 8:19 AM, Richard Damon wrote: On 11/23/17 2:46 PM, Thomas Jollans wrote: On 23/11/17 19:42, Mikhail V wrote: I mean for a real practical situation - for example for an average Python programmer or

[issue32099] Use range in itertools roundrobin recipe

2017-11-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 0858495a50e19defde786a4ec050ec182e920f46 by Raymond Hettinger in branch 'master': bpo-32099 Add deque variant of roundrobin() recipe (#4497)

[issue32099] Use range in itertools roundrobin recipe

2017-11-23 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 8:19 AM, Richard Damon wrote: > On 11/23/17 2:46 PM, Thomas Jollans wrote: >> >> On 23/11/17 19:42, Mikhail V wrote: >>> >>> I mean for a real practical situation - for example for an average >>> Python programmer or someone who seeks a programmer

[issue29302] add contextlib.AsyncExitStack

2017-11-23 Thread privatwolke
Change by privatwolke : -- nosy: +privatwolke ___ Python tracker ___ ___

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: The option seems reasonable. Would you like to work on a pull request? -- ___ Python tracker

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Richard Damon
On 11/23/17 2:46 PM, Thomas Jollans wrote: On 23/11/17 19:42, Mikhail V wrote: I mean for a real practical situation - for example for an average Python programmer or someone who seeks a programmer job. And who does not have a 500-key keyboard, I don't think it's too much to ask for a

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 8:02 AM, Mikhail V wrote: > On Thu, Nov 23, 2017 at 9:39 PM, Chris Angelico wrote: >> On Fri, Nov 24, 2017 at 7:38 AM, Mikhail V wrote: >>> I see you manually 'optimise' the look? >>> I personally would end

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Mikhail V
On Thu, Nov 23, 2017 at 9:39 PM, Chris Angelico wrote: > On Fri, Nov 24, 2017 at 7:38 AM, Mikhail V wrote: >> I see you manually 'optimise' the look? >> I personally would end with something like this: >> >> def zip_longest(*A, **K): >> value = K.get

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 7:38 AM, Mikhail V wrote: > I see you manually 'optimise' the look? > I personally would end with something like this: > > def zip_longest(*A, **K): > value = K.get ('fillvalue') > count = len(a) - 1 > def sentinel(): > nonlocal

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Mikhail V
On Thu, Nov 23, 2017 at 8:15 PM, Chris Angelico wrote: > > Let's start with a simpler question. Which of these is better code? > > # == Option 1 > class ZipExhausted(Exception): > pass > > def zip_longest(*args, **kwds): > # zip_longest('ABCD', 'xy', fillvalue='-')

[issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses

2017-11-23 Thread Berker Peksag
Berker Peksag added the comment: Looks like I forgot to backport this 3.6 branch. Now it's done. Thanks, Eli. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7, Python 3.5

[issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses

2017-11-23 Thread Berker Peksag
Berker Peksag added the comment: New changeset a645b23ffc76073a2eb4e77b88cb7648cfc6ef77 by Berker Peksag in branch '3.6': bpo-30456: Clarify example for duplicates in second argument of isinstance (GH-1699)

[issue30456] 2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses

2017-11-23 Thread Berker Peksag
Change by Berker Peksag : -- keywords: +patch pull_requests: +4466 stage: backport needed -> patch review ___ Python tracker

[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-23 Thread Antoine Pitrou
New submission from Antoine Pitrou : Right now tracemalloc.Traceback.format() returns the frames in "most recent call first" order. This is not intuitive since ordinary Python tracebacks are displayed in "most recent call last" order. It would be nice to add a `reverse`

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Mikhail V
On Thu, Nov 23, 2017 at 8:46 PM, Thomas Jollans wrote: > On 23/11/17 19:42, Mikhail V wrote: >> I mean for a real practical situation - for example for an average >> Python programmer or someone who seeks a programmer job. >> And who does not have a 500-key keyboard, > > I don't

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Karsten Hilbert
On Thu, Nov 23, 2017 at 08:46:01PM +0100, Thomas Jollans wrote: > > I mean for a real practical situation - for example for an average > > Python programmer or someone who seeks a programmer job. > > And who does not have a 500-key keyboard, > > I don't think it's too much to ask for a

[issue32107] test_uuid uses the incorrect bitmask

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm sorry, but this tests and the typo were added by me in issue23015. This check is a pair of the check for _random_getnode(). They use the same mask and test the same bit. I forgot about this. --

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Thomas Jollans
On 23/11/17 19:42, Mikhail V wrote: > I mean for a real practical situation - for example for an average > Python programmer or someone who seeks a programmer job. > And who does not have a 500-key keyboard, I don't think it's too much to ask for a programmer to have the technology and expertise

[issue32107] test_uuid uses the incorrect bitmask

2017-11-23 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Nov 23, 2017, at 11:24, Serhiy Storchaka wrote: > Wait, now I understand the purpose of the current test! There is just a typo > in a comment, should be 41 instead of 47. The test itself is correct. If the >

[issue31325] req_rate is a namedtuple type rather than instance

2017-11-23 Thread Berker Peksag
Change by Berker Peksag : -- keywords: +patch pull_requests: +4465 ___ Python tracker ___

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 5:42 AM, Mikhail V wrote: > Chris A wrote: > >>> On Fri, Nov 24, 2017 at 1:10 AM, Mikhail V wrote: >>> Chris A wrote: Fortunately for the world, you're not the one who decided which characters were permitted in Python identifiers.

[issue12382] [msilib] Obscure exception message when trying to open a non-existent MSI database

2017-11-23 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: +4464 stage: -> patch review ___ Python tracker ___

Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Mikhail V
Chris A wrote: >> On Fri, Nov 24, 2017 at 1:10 AM, Mikhail V wrote: >> >>> Chris A wrote: >>> >>> Fortunately for the world, you're not the one who decided which >>> characters were permitted in Python identifiers. The ability to use >>> non-English words for function/variable names is of huge

[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)

2017-11-23 Thread Berker Peksag
Berker Peksag added the comment: New changeset dcaed6b2d954786eb5369ec2e8dfdeefe3cdc6ae by Berker Peksag in branch 'master': bpo-19610: setup() now raises TypeError for invalid types (GH-4519)

[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)

2017-11-23 Thread Berker Peksag
Change by Berker Peksag : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6a54c676e63517653d3d4a1e164bdd0fd45132d8 by Victor Stinner in branch 'master': bpo-31979: Remove unused align_maxchar() function (#4527) https://github.com/python/cpython/commit/6a54c676e63517653d3d4a1e164bdd0fd45132d8

[issue32030] PEP 432: Rewrite Py_Main()

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset b9197959c186f9061bd74d0adc20e96556426db4 by Victor Stinner in branch 'master': bpo-32030: Fix calculate_path() on macOS (#4526) https://github.com/python/cpython/commit/b9197959c186f9061bd74d0adc20e96556426db4

[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: I tested set_match_tests() on python2.7 with: python2.7 -m test --list-cases > cases python2.7 -m test.bisect -i cases Good news: the set().__contains__ matcher can be used! -- ___ Python

[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 35d99830f1878867e3964577741d9a2d5a7fc8f7 by Victor Stinner in branch '2.7': bpo-31324: Optimize support._match_test() (#4523) (#4524) https://github.com/python/cpython/commit/35d99830f1878867e3964577741d9a2d5a7fc8f7

[issue32055] Reconsider comparison chaining for containment tests

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm reading the list of most rated in a week questions on StackOverflow (https://python-weekly.blogspot.com/), and it seems to me that the question about chained "in" and "not in" is raised every few months. This may be the one

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > How about not posting about this topic for 24 hours. OK, makes sense :-) -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Guido van Rossum
Guido van Rossum added the comment: I think we all need to calm down a bit. How about not posting about this topic for 24 hours. -- ___ Python tracker

[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4463 ___ Python tracker ___ ___

[issue32030] PEP 432: Rewrite Py_Main()

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4462 ___ Python tracker ___ ___

[issue13986] ValueError: cannot convert float NaN to integer

2017-11-23 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: -gregory.p.smith ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Guido, I am not sure about the complete removal, this is probably to radical. What I think we are missing more detailed docs that would be clear about the corner cases. (I already mentioned this in https://bugs.python.org/issue32113)

[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4461 ___ Python tracker ___ ___

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury OK, sorry then this is a misunderstanding from my side. NP. Again, sorry if I sounded that way to you. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yury OK, sorry then this is a misunderstanding from my side. -- ___ Python tracker ___

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: >> Do you understand the difference? > Yury, sorry, but what is your problem? Have I said something about that this > is bad. Your tone is clearly insulting, and this is not the first time. Maybe > it makes sense to have some respect?

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Do you understand the difference? Yury, sorry, but what is your problem? Have I said something about that this is bad. Your tone is clearly insulting, and this is not the first time. Maybe it makes sense to have some respect?

[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 70b2f8797146a56a6880743424f0bedf4fc30c62 by Victor Stinner in branch '3.6': [3.6] bpo-31324: Optimize support._match_test() (#4523) https://github.com/python/cpython/commit/70b2f8797146a56a6880743424f0bedf4fc30c62

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > Well, after all I am thinking maybe it is indeed makes sense to ban `yield` > inside both sync/async and both comprehensions/generator expressions. I agree, as I can't imagine a real use case for a = ((yield a) for a in as) which

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Guido van Rossum
Guido van Rossum added the comment: I honestly think we went too far here. Asynchronous generators are still provisional. Though the PEP is silent about this, the acceptance notice is clear: https://mail.python.org/pipermail/python-dev/2016-September/146267.html. I propose to

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Well, after all I am thinking maybe it is indeed makes sense to ban `yield` inside both sync/async and both comprehensions/generator expressions. Since we already have a smörgåsbord of intuitive behaviors. This, _together_ with

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > ... but [await x for x in xs] is still valid _only_ inside async def. Yes, because it's computed right where it is defined. a = [x for x in xs] # `a` is a list object a = (x for x in xs) # `a` is a generator Do you understand the

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: ... but [await x for x in xs] is still valid _only_ inside async def. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: It's also important to note, that in 3.7, this is legal: def foo(): return (await x for x in xs) Note that 'foo' is a regular function, not 'async def'. -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury explained why this happens in https://bugs.python.org/issue32113 It happens because '(x for x in xs)' creates a synchronous generator. So when there's an 'await' in it, it creates an asynchronous generator. --

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: (Of course there should be not [1, 2] in the argument, but a list of some awaitables, otherwise there will be an error later.) -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > Remind me what happens when you use `await` in a generator expression that > survives the async function's scope? Awaiting on f([1, 2]) will result in an async generator (even though yield never appears here). Yury explained why this

[issue32107] test_uuid uses the incorrect bitmask

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Wait, now I understand the purpose of the current test! There is just a typo in a comment, should be 41 instead of 47. The test itself is correct. If the address is obtained from network cards, it should have the 41 bit clear.

[issue10544] yield expression inside generator expression does nothing

2017-11-23 Thread Guido van Rossum
Guido van Rossum added the comment: Remind me what happens when you use `await` in a generator expression that survives the async function's scope? async def f(xs): return (await x for x in xs) -- ___ Python tracker

[issue27535] Ignored ResourceWarning warnings leak memory in warnings registries

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset b98f1715a35d2cbd1e9e45e1e7ae51a39e00dc4a by Victor Stinner in branch 'master': bpo-27535: Cleanup create_filter() (#4516) https://github.com/python/cpython/commit/b98f1715a35d2cbd1e9e45e1e7ae51a39e00dc4a --

[issue32118] Docs: add note about sequence comparisons containing non-orderable elements

2017-11-23 Thread R. David Murray
R. David Murray added the comment: The surprising thing is the behavior of NaN, which is *not equal* to itself. The statement about orderability says "...are ordered the same as their first unequal elements". This is explicit and unambiguous, there is no difference in

[issue30657] Unsafe arithmetic in PyString_DecodeEscape

2017-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Right, but it is not easy to exploit this bug. You need to parse Python sources longer than 512 MiB in 32-bit Python. Python 3.5 currently takes only fixes for security bugs. I left on to Larry to decide whether it is worth to

[issue29512] regrtest refleak: implement bisection feature

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 448c6739877a4143a2c3599f041fa6127f354044 by Victor Stinner in branch '2.7': bpo-29512: Fix Lib/test/bisect.py shebang (#4522) https://github.com/python/cpython/commit/448c6739877a4143a2c3599f041fa6127f354044

[issue32030] PEP 432: Rewrite Py_Main()

2017-11-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 0327bde9da203bb256b58218d012ca76ad0db4e4 by Victor Stinner in branch 'master': bpo-32030: Rewrite calculate_path() (#4521) https://github.com/python/cpython/commit/0327bde9da203bb256b58218d012ca76ad0db4e4 --

[issue31324] support._match_test() used by test.bisect is very inefficient

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4460 ___ Python tracker ___ ___

[issue29512] regrtest refleak: implement bisection feature

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +4459 stage: resolved -> patch review ___ Python tracker ___

[issue30657] Unsafe arithmetic in PyString_DecodeEscape

2017-11-23 Thread Leo kirotawa silva
Leo kirotawa silva added the comment: I couldn't reproduce using the poc, but seems python3.5 is also vulnerable to this bug. The code from py3.5 are quite similar to 2.7. In py3.5: Objects/bytesobject.c PyBytes_DecodeEscape -- nosy: +Leo kirotawa silva

[issue32030] PEP 432: Rewrite Py_Main()

2017-11-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +4458 ___ Python tracker ___ ___

Re: Allow additional separator character in variables

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 1:39 AM, Mikhail V wrote: > Chris A wrote: > > On Fri, Nov 24, 2017 at 1:10 AM, Mikhail V wrote: >> >> > Well, then there is some bitter irony in this, so it allows pretty >> > much everything, >> > but does not allow me to beautify code with

Re: Python loop and web server (bottle) in the same script

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 1:27 AM, wrote: > I would like to have a script that collects data every minute and at the same > time serve newly collected data as web pages. > > Timely collecting data is more important than serving web pages, so > collecting data should have

  1   2   >