[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The old generate_tokens() was renamed to tokenize() in issue719888 because the latter is a better name. Is "generate_tokens" considered a good name now? -- ___ Python tracker

[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +barry, mark.dickinson, michael.foord, trent versions: +Python 3.8 -Python 3.6 ___ Python tracker ___ _

[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-18 Thread Mark Dickinson
Mark Dickinson added the comment: > total should be a cached property, that's updated on every Counter update That would run into difficulties for Counters with float values: e.g., after >>> c = Counter() >>> c['spam'] = 1e100 >>> c['eggs'] = 1 >>> c['spam'] = 0 the cached total would likely

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Ammar Askar
Ammar Askar added the comment: >core-workflow made a premature decision to turn off Travis and AppVeyor and >make VSTS blocking. It looks like AppVeyor and Travis are still running as of the latest PR: https://github.com/python/cpython/pull/6965 Annoyingly, I don't think there's a way to mak

[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-18 Thread Vedran Čačić
Vedran Čačić added the comment: Well, yes, floats are innacurate. Do you really expect to normalize Counters containing values like a googol, or was it just a strawman? For me, it is much more imaginable* that total be zero because you have a negative value (e.g. {'spam': -1, 'eggs': 1}) than

[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-18 Thread Mark Dickinson
Mark Dickinson added the comment: The point is that if you cache the total and update on each operation, you end up with a total that depends not just on the current contents of the Counter, but also on the history of operations. That seems like a bad idea: you could have two Counters with ex

[issue33565] strange tracemalloc results

2018-05-18 Thread Andrew Svetlov
Andrew Svetlov added the comment: Victor, could you take a look? -- nosy: +asvetlov, vstinner ___ Python tracker ___ ___ Python-bugs

[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: I wouldn't say it's a good name, but I think the advantage of documenting an existing name outweighs that. We can start (or continue) using generate_tokens() right away, whereas a new name presumably wouldn't be available until Python 3.8 comes out. And we us

[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My concern is that we will have two functions with non-similar names (tokenize() and generate_tokens()) that does virtually the same, but accept different types of input (bytes or str), and the single function untokenize() that produces different type of re

[issue33554] Optimize PyDictObject

2018-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm -1 too. There are no visible benefits, but this change makes maintaining harder and adds a risk of introducing bugs and performance regression. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed _

[issue33559] Exception's repr change not documented

2018-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report and PR Miro! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker __

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Min
New submission from Min : Firstly, I wrote something like this: patn = r"\bROW\s*\((\d+|\*)\)(.|\s)*?\)" newlines = re.sub(patn, "\nY\n", newlines) but if the file(or string) ended without the expected ")" the code deadlock there, no progress, no exception, a

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Min
Min added the comment: Sorry, forgot I have upgraded to 3.6.2, not 3.5 -- versions: +Python 3.6 -Python 3.5 ___ Python tracker ___ _

[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-18 Thread Vedran Čačić
Vedran Čačić added the comment: My reading of the documentation says floats are only tentatively supported. The main text of the documentation says the values are supposed to be integers. Even the note mostly talks about negative values, the floats are mentioned in only one item. (And in that

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Min
Min added the comment: Sorry again, the sample code offered is issue of re.sub(), not findall() :o))) -- ___ Python tracker ___ ___

[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: I agree, it's not a good design, but it's what's already there; I just want to ensure that it won't be removed without a deprecation cycle. My PR makes no changes to behaviour, only to documentation and tests. This and issue 9969 have both been around for sev

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi Steve I just saw VSTS in action, it's a great job, thank you. Compared to Travis-CI: * is there more computers for the tests on VSTS? * with time, what will be the reference if there is a 'green' build? TravisCI or VSTS? Thank you again for the job. -

[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Martin Panter
Martin Panter added the comment: Don’t forget about updating __all__. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Thomas Kluyver
Thomas Kluyver added the comment: Thanks - I had forgotten it, just fixed it now. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue33567] Explicitly mention bytes and other buffers in the documentation for float()

2018-05-18 Thread Martijn Pieters
New submission from Martijn Pieters : float(bytesobject) treats the contents of the bytesobject as a sequence of ASCII characters, and converts those to a float value as if you used float(bytesobject.decode('ASCII')). The same support is extended to other objects implementing the buffer protoc

[issue33565] strange tracemalloc results

2018-05-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Can you post a reproducer that doesn't involve S3? -- nosy: +pitrou ___ Python tracker ___ ___ Pyt

[issue33567] Explicitly mention bytes and other buffers in the documentation for float()

2018-05-18 Thread Joël Schaerer
Change by Joël Schaerer : -- nosy: +joelthelion ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2018-05-18 Thread Licht Takeuchi
Change by Licht Takeuchi : -- keywords: +patch pull_requests: +6625 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue32463] problems with shutil.py and os.get_terminal_size

2018-05-18 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. I agree with Eryk. os.get_terminal_size() is a low-level function. shutil.get_terminal_size() should be used as documented at https://docs.python.org/3/library/os.html#os.get_terminal_size shutil.get_terminal_size() is the high-level

[issue33568] Inconsistent behavior of non-ascii handling in EmailPolicy.fold

2018-05-18 Thread Licht Takeuchi
New submission from Licht Takeuchi : policy.utf8 is False, but non-ascii are not well-handled. Repro. code. ``` Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from email.message impor

[issue33568] Inconsistent behavior of non-ascii handling in EmailPolicy.fold

2018-05-18 Thread Licht Takeuchi
Change by Licht Takeuchi : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue33569] dataclasses InitVar does not maintain any type info

2018-05-18 Thread reinhrst
New submission from reinhrst : Right now dataclasses.InitVar[something] is dataclasses.InitVar. This means that any type-information is removed, and it will (for instance) be impossible to do (runtime) type info checks on the generated __init__, or find out anything about the type of the varia

[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2018-05-18 Thread Aviv Palivoda
Change by Aviv Palivoda : -- nosy: +palaviv ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue33570] OpenSSL 1.1.1 / TLS 1.3 cipher suite changes

2018-05-18 Thread Christian Heimes
New submission from Christian Heimes : The definition and configuration of TLS 1.3 cipher suites has changed during the development phase of OpenSSL 1.1.1. The cipher suites are no longer prefixed with "TLS13-". TLS 1.3 are always enabled and can no longer be disabled with SSLContext.set_ciphe

[issue30437] SSL_shutdown needs SSL_read() until SSL_ERROR_ZERO_RETURN

2018-05-18 Thread Christian Heimes
Christian Heimes added the comment: The issue can occur when the peer sends data while processing the close notify alert. The meaningless SSL_ERROR_SYSCALL in SSL_shutdown() is even more severe with OpenSSL 1.1.1 and TLS 1.3. In case the client only writes and never reads, SSL_shutdown fails

[issue32519] venv API docs - symlinks default incorrect

2018-05-18 Thread Berker Peksag
Change by Berker Peksag : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue33571] Add triple quotes to list of delimiters that trigger '...' prompt

2018-05-18 Thread Andrés Delfino
Change by Andrés Delfino : -- assignee: docs@python components: Documentation nosy: adelfino, docs@python priority: normal severity: normal status: open title: Add triple quotes to list of delimiters that trigger '...' prompt type: enhancement versions: Python 2.7, Python 3.6, Python 3.7

[issue33571] Add triple quotes to list of delimiters that trigger '...' prompt

2018-05-18 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch pull_requests: +6626 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Steve Dower
Steve Dower added the comment: > * is there more computers for the tests on VSTS? I don't know what Travis is giving us, but Microsoft has provided 20 concurrent builds. They also seem to be more powerful machines, though some caching features are missing and many builds seem to take about th

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Steve Dower
Steve Dower added the comment: > I don't think there's a way to make certain checks like VSTS be optional and > not show up with a red cross on Github Most of the failures I've seen have been reproducible, so I suspect they're due to race conditions that rarely occurred on Travis. Unfortunate

[issue33507] Improving the html rendered by cgitb.html

2018-05-18 Thread Stéphane Blondon
Stéphane Blondon added the comment: > Instead of hardcoding colors, would it be better to use CSS instead. I agree with you. The current source code contains hardcoded colors. I could add an optional parameter to change the css for the cgitb.html() function: def html(einfo, context=5, css=_DEF

[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-18 Thread Ivan Pozdeev
Change by Ivan Pozdeev : -- pull_requests: +6627 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Janusz Harkot
New submission from Janusz Harkot : using boolean (True/False) as dictionary keys, coerce them to integers - is this behavior documented somewhere? I know that asking to fix this is not easy fix, but shouldn't this be highlighted everywhere with red flags and warnings, so people will know that

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Janusz Harkot
Janusz Harkot added the comment: Python 3.6.5 (default, Mar 29 2018, 03:28:50) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> dta = {False: 'false', True: 'true', 0: 'zero', 1: 'one'} >>> print(dta[False]) zero >>> dta {False: 'zero', Tru

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: I've emailed support@github on this one. Their UI is horrible, "show all checks" does not show them all. It shows five at most. It is an invisible scrolling region. We're forced to manually mouse over and scroll down in that region in order to confirm th

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bu

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Mark Dickinson
Mark Dickinson added the comment: It's documented here: https://docs.python.org/3/library/stdtypes.html#mapping-types-dict > Numeric types used for keys obey the normal rules for numeric > comparison: if two numbers compare equal (such as 1 and 1.0) then > they can be used interchangeably to

[issue33477] Document that compile(code, 'exec') has different behavior in 3.7+

2018-05-18 Thread INADA Naoki
INADA Naoki added the comment: Any comments? Would you close this issue? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue33477] Document that compile(code, 'exec') has different behavior in 3.7+

2018-05-18 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: Fair enough that what's new include things about Module > The first statement in their body is not considered as a docstring anymore. Note that this sentence read backward to me. I understand what is meant because I know the new behavior. It might be go

[issue19251] bitwise ops for bytes of equal length

2018-05-18 Thread Stefan Behnel
Stefan Behnel added the comment: I'd second the proposal of considering the "array.array" type for this, instead of the bytes/bytearray types. Why? Because it is somewhat of a niche case after all, and the bytes type seems too exposed for it. Also, array.array supports more diverse base item

[issue33471] string format with 'n' failling with french locales

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33492] Updating the Evaluation order section to cover *expression in calls

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue19251] bitwise ops for bytes of equal length

2018-05-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Please, let's have this API discussion outside of the bug tracker. This deserves a PEP. Also because I have an alternative API to suggest :-) -- ___ Python tracker ___

[issue32282] When using a Windows XP compatible toolset, `socketmodule.c` fails to build

2018-05-18 Thread Berker Peksag
Berker Peksag added the comment: New changeset 09eb6fe8fdd2515546b933902aef36b72d417ace by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-32282: Remove unnecessary check for `VersionHelpers.h` in `socketmodule.c` on Windows (GH-5120) https://github.com/python/cpython/commit/09eb6fe

[issue32282] When using a Windows XP compatible toolset, `socketmodule.c` fails to build

2018-05-18 Thread Berker Peksag
Berker Peksag added the comment: It looks like we need to backport this manually for 3.5 (if Larry approves) -- stage: patch review -> backport needed versions: -Python 3.6, Python 3.7 ___ Python tracker ___

[issue33477] Document that compile(code, 'exec') has different behavior in 3.7+

2018-05-18 Thread Matthias Bussonnier
Change by Matthias Bussonnier : -- keywords: +patch pull_requests: +6628 stage: -> patch review ___ Python tracker ___ ___ Python-bu

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Matthew Barnett
Matthew Barnett added the comment: You don't give the value of 'newlines', but the problem is probably catastrophic backtracking, not deadlock. -- nosy: +mrabarnett ___ Python tracker ___

[issue33566] re.findall() dead locked whent the expected ending char not occur until end of string

2018-05-18 Thread Tim Peters
Tim Peters added the comment: Min, you need to give a complete example other people can actually run for themselves. Offhand, this part of the regexp (.|\s)* all by itself _can_ cause exponential-time behavior. You can run this for yourself: >>> import re >>> p = r"(.|\s)*K" >>> re.search(

[issue33500] Python TKinter for Mac on latest 2.7.15 still extremely slow vs Windows

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Responses to the following might help anyone who works on this. 1. Is the relative performance only an issue on 2.7 and not 3.6+? 2. What are the 'recent issues here'? What is different about your example code. 3. We prefer plain text .py files that can be

[issue33516] unittest.mock: Add __round__ to supported magicmock methods

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +michael.foord versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue33527] Invalid child function scope

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- stage: -> test needed versions: -Python 3.4, Python 3.5 ___ Python tracker ___ ___ Python-bugs-list m

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: Mark, are you suggesting a doc addition (and a change of Components) or should we close this as 'not a bug'? -- nosy: +terry.reedy ___ Python tracker ___

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Tim Peters
Tim Peters added the comment: I expect these docs date back to when ints, longs, and floats were the only hashable language-supplied types for which mixed-type comparison could ever return True. They could stand some updates ;-) `fractions.Fraction` and `decimal.Decimal` are more language-s

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread Zachary Ware
Zachary Ware added the comment: New changeset 5634331a76dfe9fbe4b76475e11307a0922d6a15 by Zachary Ware (Skip Montanaro) in branch 'master': bpo-33556: Remove reference to thread module from docstring (GH-6963) https://github.com/python/cpython/commit/5634331a76dfe9fbe4b76475e11307a0922d6a15

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6629 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6630 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue33572] False/True as dictionary keys treated as integers

2018-05-18 Thread Terry J. Reedy
Change by Terry J. Reedy : -- assignee: -> docs@python components: +Documentation -Interpreter Core nosy: +docs@python ___ Python tracker ___ __

[issue33573] statistics.median does not work with ordinal scale

2018-05-18 Thread W deW
New submission from W deW : The 0.5-quantile or median is defined for ordinal, interval, and ratio scales. An Enumerator as derived from Enum and extended with rich comparison methods implements an ordinal scale. Therefore calculating the median over a list of such enum-elements ought to be po

[issue33574] Conversion of Number to String(str(number))

2018-05-18 Thread Khalid Moh'd.
New submission from Khalid Moh'd. : Consider conversion of an integer to string: a=5 #number str #outputs str(a) #works perfectly and prints '5' Now, consider: str="Hello World" #reads the string str #prints "Hello World" str(5) #gives an error Interpreter considers variable str before parent

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread Rolf Campbell
Rolf Campbell added the comment: Re-opening because I've found a simple example that does not involve __main__. ./func/__init__.py:func = 1 ./func/__init__.py:from . import func ./func/__init__.py:print(f"Namespace value of func after func module import:{func}") ./func/func.py:print("Module im

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread Rolf Campbell
Change by Rolf Campbell : -- resolution: not a bug -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread miss-islington
miss-islington added the comment: New changeset c6a5cc8f244ee71ce932003366411aacadda8dd0 by Miss Islington (bot) in branch '3.6': bpo-33556: Remove reference to thread module from docstring (GH-6963) https://github.com/python/cpython/commit/c6a5cc8f244ee71ce932003366411aacadda8dd0 --

[issue33565] strange tracemalloc results

2018-05-18 Thread Alexander Mohr
Alexander Mohr added the comment: here's a version that tries to do something similar but does not reproduce the issue -- Added file: https://bugs.python.org/file47602/tracemalloc_test2.py ___ Python tracker ___

[issue33572] Better document mixed-type comparison of set items, dict keys

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: With Tim's addition >>> from fractions import Fraction as F >>> from decimal import Decimal as D >>> s = {0, 1, 0.0, 1.0, F(0,1), F(1, 1), D(0), D(1), False, True} >>> s {0, 1} I think we should consider moving the main discussion of the general comparison an

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread Zachary Ware
Zachary Ware added the comment: New changeset abde17e663edd6437cc7eb0405fe418449a25d72 by Zachary Ware (Miss Islington (bot)) in branch '3.7': bpo-33556: Remove reference to thread module from docstring (GH-6963) https://github.com/python/cpython/commit/abde17e663edd6437cc7eb0405fe418449a25d72

[issue33556] leftover thread crumb in threading.ident docstring

2018-05-18 Thread Zachary Ware
Zachary Ware added the comment: Done, thanks Skip :) Can we convince you to reclaim your commit bits so you can click the buttons yourself next time? ;) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python trac

[issue33570] OpenSSL 1.1.1 / TLS 1.3 cipher suite changes

2018-05-18 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +6631 stage: test needed -> patch review ___ Python tracker ___ ___ P

[issue33447] Asynchronous lambda syntax

2018-05-18 Thread Yury Selivanov
Yury Selivanov added the comment: The syntax for async lambdas doesn't look nice and I, personally, don't see that many use cases for them to justify adding new syntax. And this would need a new PEP. I suggest to start a discussion on the Python-ideas mailing list if this is something you

[issue33574] Conversion of Number to String(str(number))

2018-05-18 Thread Eric V. Smith
Eric V. Smith added the comment: The way to avoid this problem is to not assign to str. You should not shadow python builtins that you want to continue using. -- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: compile error -> crash ___

[issue33522] Enable CI builds on Visual Studio Team Services

2018-05-18 Thread Steve Dower
Steve Dower added the comment: GitHub has broken CSS everywhere right now :) Their oauth page doesn't show scroll bars either, which means you can't get to the "authorise" button if you're in more than a couple of organisations. -- ___ Python track

[issue30437] SSL_shutdown needs SSL_read() until SSL_ERROR_ZERO_RETURN

2018-05-18 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +6632 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue22848] Subparser help does not respect SUPPRESS argument

2018-05-18 Thread Andrew Gaul
Change by Andrew Gaul : -- nosy: +gaul ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue33540] socketserver: Add an opt-in option to get Python 3.6 behaviour on server_close()

2018-05-18 Thread Ned Deily
Ned Deily added the comment: It would be great if someone(s) could give PR 6911 a review, since it is a release blocker for 3.7.0rc1. Thanks! -- ___ Python tracker ___ __

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread R. David Murray
R. David Murray added the comment: It's the same answer. __init__ *is* the package namespace, so you are setting the value of 'func' in the package (.) namespace, and what import is doing is correct. I know this is confusing. I banged my head against it while debugging a weird import probl

[issue33447] Asynchronous lambda syntax

2018-05-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: The only thing special about functions defined with lambda expressions rather than def statements is the generic name attribute '' instead of a specific name. PEP8 intentionally and properly discourages 'name = lambda ...' as inferior to 'def name(...'. For

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread Rolf Campbell
Rolf Campbell added the comment: OK, OK, I think I finally understand what you mean here. Let me try to repeat it just to make sure I really understand: When requesting a member of a multi-file module (like "func" in my example), python only tries to load that member as a module from disk if

[issue33547] Relative imports do not replace local variables

2018-05-18 Thread R. David Murray
R. David Murray added the comment: Yes, you are substantially correct. A subtlety that may enhance your understanding (if it doesn't instead totally confuse you :) is that __init__ is simply the most straightforward way to affect the module namespace. You would see the same phenomenon if in

[issue32996] Improve What's New in 3.7

2018-05-18 Thread Elvis Pranskevichus
Change by Elvis Pranskevichus : -- pull_requests: +6633 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue28556] typing.py upgrades

2018-05-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset f65e31fee3b55dfb6ed5398179d5c5d6b502dee5 by Ivan Levkivskyi in branch 'master': bpo-28556: Don't simplify unions at runtime (GH-6841) https://github.com/python/cpython/commit/f65e31fee3b55dfb6ed5398179d5c5d6b502dee5 -- ___

[issue28556] typing.py upgrades

2018-05-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +6634 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue33521] Add 1.32x faster C implementation of asyncio.isfuture().

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: About the benchmark: you should not loop inside the function. I propose a variant of the benchmark: isfuture_benchmark2.py. Jimmy: Would you mind to run this variant on your PR? -- Added file: https://bugs.python.org/file47603/isfuture_benchmark2.py

[issue28556] typing.py upgrades

2018-05-18 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 09ca5906b7d1619b7efed0bebb6f3c424fe3d83b by Ivan Levkivskyi (Miss Islington (bot)) in branch '3.7': bpo-28556: Don't simplify unions at runtime (GH-6841) (GH-6979) https://github.com/python/cpython/commit/09ca5906b7d1619b7efed0bebb6f3c424fe3d83b

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +6635 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue30273] The coverage job is broken: distutils build_ext fails on None

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: https://github.com/python/cpython/pull/1515 has the "needs backport to 2.7" label, but I'm unable to reproduce the bug on Python 2.7: * Python 2.7 has no "venv" module * When I compile Python out of tree, and then use "virtualenv -p ./python VENV", I got the

[issue33518] Add PEP to glossary

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset a3a554a536599189166843cd80e62d02b2b68aa8 by Victor Stinner (Andrés Delfino) in branch '3.7': [3.7] bpo-33518: Add PEP entry to documentation glossary (GH-6860) (#6934) https://github.com/python/cpython/commit/a3a554a536599189166843cd80e62d02b2b68

[issue33518] Add PEP to glossary

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset fb5d0aa116125dfb29a3c4d8819a38dfb2760bb9 by Victor Stinner (Andrés Delfino) in branch '3.6': [3.6] bpo-33518: Add PEP entry to documentation glossary (GH-6860) (#6935) https://github.com/python/cpython/commit/fb5d0aa116125dfb29a3c4d8819a38dfb2760

[issue33358] [EASY] x86 Ubuntu Shared 3.x: test_embed.test_pre_initialization_sys_options() fails

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: Thank you for the fix Pablo! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue20104] expose posix_spawn(p)

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: posix_spawn can still be found in Python 3.7: configure:11243: posix_fallocate posix_fadvise posix_spawn pread preadv preadv2 \ configure.ac:3470: posix_fallocate posix_fadvise posix_spawn pread preadv preadv2 \ pyconfig.h.in:710:/* Define to 1 if you have th

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset d13169fc5ac7572a272cbcff830c3d96ba27cc7c by Victor Stinner in branch '2.7': bpo-16055: Fixes incorrect error text for int('1', base=1000) (#6980) https://github.com/python/cpython/commit/d13169fc5ac7572a272cbcff830c3d96ba27cc7c --

[issue16055] incorrect error text for int(base=1000, x='1')

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: I backported manually the fix to Python 2.7 for int and long types. Thank you Chris Jerdonek for the bug report, and Sanyam Khurana for the bugfix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7, P

[issue33575] Python relies on C undefined behavior float-cast-overflow

2018-05-18 Thread Gregory P. Smith
New submission from Gregory P. Smith : Clang's undefined behavior sanitizer is flagging several places in CPython where it is relying on float-cast-overflow behavior. Typically exposed where an out of bounds floating point value is cast to another type. The clang compiler is about to start ap

[issue32534] Speed-up list.insert: use memmove()

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: This issue is a micro-optimization which is only 1.08x faster: https://bugs.python.org/issue32534#msg310146 Moreover, it seems really hard to measure precisely the benefit on benchmarks. Results seem to not be reliable. I suggest to close the issue as WONTFIX

[issue20104] expose posix_spawn(p)

2018-05-18 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I originally removed it from the configure script in PR6794 but it was reintroduced in commit 57009526f6a405e0ffe8c16012cce509b62cb577. Check the PR for Greg's rationale. -- ___ Python tracker

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: Oh, it seems like I was wrong in my previous comment. Python 2.7 code base is already designed to support native TLS. It's just that we only implement native TLS on Windows. So yeah, it seems doable to implement native TLS for pthread. History of Py_HAVE_NATI

[issue33470] Changes from GH-1638 (GH-3575, bpo-28411) are not documented in Porting to Python 3.7

2018-05-18 Thread STINNER Victor
STINNER Victor added the comment: > Sorry for mixing two things here, but I meant that I found out about this > because of the private API use in gdb, however nothing from the change is > documented on whatsnew at all. It seems like there is at least one change in the public API: the removal

  1   2   >