[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks for the report and patch. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 ___ Python tracker

[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset d7947280a4ba9dc652c3fac22946466338ec6999 by Terry Jan Reedy in branch '3.7': [3.7] bpo-39136: Fixed typos (GH-17720) https://github.com/python/cpython/commit/d7947280a4ba9dc652c3fac22946466338ec6999 --

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Andy Lester
Andy Lester added the comment: Thank you. I appreciate the pointer. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39151] Simplify the deep-first-search of the assembler

2019-12-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +17178 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17733 ___ Python tracker

[issue39134] can't construct dataclass as ABC (or runtime check as data protocol)

2019-12-28 Thread Guido van Rossum
Guido van Rossum added the comment: Have you tried dropping ABCMeta? Mypy checks @abstractmethod regardless. -- ___ Python tracker ___

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > PyToken_OneChar in Parser/token.c is autogenerated. I suspect it may be > faster and smaller if it were a lookup into a static table of ops rather than > a switch statement. Check to see if it is. I suspect that it will be marginally faster

[issue25087] Type variable substitution in type instances

2019-12-28 Thread Guido van Rossum
Guido van Rossum added the comment: Yup, see comment in https://github.com/python/typing/pull/308 regarding #156. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue15723] Python breaks OS' append guarantee on file writes

2019-12-28 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39151] Simplify the deep-first-search of the assembler

2019-12-28 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : I was recently checking the code of the assembler and when looking in detail at the dfs() function I was surprised by this code: static void dfs(struct compiler *c, basicblock *b, struct assembler *a, int end) { while (j < end) { b

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I'm afraid nailing anything here is hard. For example, I don't know what you > did to "measure memory", but if you're using stats reported by the OS, that's > fraught with dangers too. I am interposing a custom allocator to track all the used

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Tim Peters
Tim Peters added the comment: All right! So, at a first look, "buffering" isn't an obvious disaster ;-) I'm afraid nailing anything here is hard. For example, I don't know what you did to "measure memory", but if you're using stats reported by the OS, that's fraught with dangers too.

[issue39150] See if PyToken_OneChar would be faster as a lookup table

2019-12-28 Thread Andy Lester
New submission from Andy Lester : PyToken_OneChar in Parser/token.c is autogenerated. I suspect it may be faster and smaller if it were a lookup into a static table of ops rather than a switch statement. Check to see if it is. -- components: Interpreter Core messages: 358975 nosy:

[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy
Change by Terry J. Reedy : -- pull_requests: +17177 pull_request: https://github.com/python/cpython/pull/17732 ___ Python tracker ___

[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset df647f3340d7a40628ba731f80425cb469e72653 by Terry Jan Reedy in branch '3.8': [3.8] bpo-39136: Fixed typos (GH-17720) https://github.com/python/cpython/commit/df647f3340d7a40628ba731f80425cb469e72653 --

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have attached two files to the issue. One of them (vanilla-vs-buffered) shows the mean memory profile of running test_asyncio 1000 times with the buffered GC and without the buffered GC. The other file shows the difference between both curves.

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : Added file: https://bugs.python.org/file48807/vanilla-vs-buffered.png ___ Python tracker ___ ___

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : Added file: https://bugs.python.org/file48808/diff-vanilla-buffered.png ___ Python tracker ___ ___

[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy
Change by Terry J. Reedy : -- pull_requests: +17176 pull_request: https://github.com/python/cpython/pull/17731 ___ Python tracker ___

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Oh, I don't expect it to help appreciably - which is why I never did it ;-) > It's aimed at something different, I think, than what you're after: reducing > the burden of cyclic gc on objects that would otherwise soon be reclaimed by >

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Tim Peters
Tim Peters added the comment: Oh, I don't expect it to help appreciably - which is why I never did it ;-) It's aimed at something different, I think, than what you're after: reducing the burden of cyclic gc on objects that would otherwise soon be reclaimed by refcounting anyway. But such

[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2019-12-28 Thread Nathaniel Smith
Change by Nathaniel Smith : -- nosy: +njs ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39136] Typos in whatsnew file and docs

2019-12-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 6c7bb38ff2799ac218e6df598b2b262f89e2bc1e by Terry Jan Reedy (Gurupad Hegde) in branch 'master': bpo-39136: Fixed typos (GH-17720) https://github.com/python/cpython/commit/6c7bb38ff2799ac218e6df598b2b262f89e2bc1e -- nosy: +terry.reedy

[issue34118] Fix some class entries in 'Built-in Functions'

2019-12-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: I closed #39112, about tuple only, as a duplicate of this. -- keywords: +patch versions: +Python 3.9 -Python 3.6 ___ Python tracker ___

[issue38938] Possible performance improvement for heaqq.merge()

2019-12-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: PR 17729 is a C implementation of a non-recursive "flattening" of the the recursive-lazy-mergesort algorithm into a tournament whose state is a tree of losers of comparisons. -- ___ Python tracker

[issue39112] Misleading documentation for tuple

2019-12-28 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Fix some class entries in 'Built-in Functions' ___ Python tracker

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2019-12-28 Thread xitop
xitop added the comment: Please, could some experienced Python developer take a look at this issue reported more than 3 month ago? -- ___ Python tracker ___

[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Leonardo Galani
Leonardo Galani added the comment: I would totally agree if it wasn't for this: >>> 'a' and 'b' and 'g' in dict False The last evaluation is False, making the whole statement False. but thanks for the documentation link and stackoverflow suggestion. it sure does make the code more readable.

[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Ned Deily
Ned Deily added the comment: P.S. You should also read the "Operator precedence" section for expressions in the Python Language Reference manual which explains that comparison operators bind tighter than Boolean AND operators:

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > For example, break the youngest generation into parts A & B. Newly tracked > items are added to part A. When a collection occurs, only part B > participates from the youngest generation. When the collection ends, part A > is renamed to part B,

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: > About "5 bits", no, we don't have 'em. Even the relatively modest > ugliness > we have now makes it impossible to port Python to a word->addressed machine > (I'm not sure any still exist!). Nothing in C >guarantees the last 2 or 3 > bits of a pointer

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2019-12-28 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the details. Attached is a complete script. Looking at the source code, anything that looks like a tuple is converted into a tuple. namedtuple produces factory function that itself is a subclass of tuple. It led me to this interesting

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: > I suppose we would need to experiment, but for what I have seen I think two or three :) What do you think? IMO, I think experimenting with two steps is good enough. -- ___ Python tracker

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Tim Peters
Tim Peters added the comment: Long ago I thought about adding "a buffer in front of" CPython's cyclic gc: newly tracked items would be added there, and not participate in cyclic gc at all until a collection passed. For example, break the youngest generation into parts A & B. Newly tracked

[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > How many semi-spaces do you think of having in this generation? Most systems > have and recommend two. I suppose we would need to experiment, but for what I have seen I think two or three :) What do you think? > If it is a worse tradeoff to

[issue25087] Type variable substitution in type instances

2019-12-28 Thread Batuhan
Batuhan added the comment: It looks like the issue in typing tracker closed, can we also close this? -- nosy: +BTaskaya ___ Python tracker ___

[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: It's intended as non-empty strings evaluate to True so you with `'a' and 'b' and 'c' in dict` you are essentially evaluating `'a' and 'b' and ('c' in dict)` with brackets precedence i.e. `True and True and True` . On the other hand `'a' and 'g'

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: >5 bit *per object* is a lot because it scales with the number of objects. It >will quickly obliterate >any gain that we get from some objects being >deallocated sooner (which is what we are trying >to achieve). Using >inter-generations has a constant

[issue39149] False positive using operator 'AND' while checking keys on dict()

2019-12-28 Thread Leonardo Galani
New submission from Leonardo Galani : using Python 3.7.6 (default, Dec 27 2019, 09:51:07) @ macOs dict = { 'a': 1, 'b': 2, 'c': 3 } if you `if 'a' and 'b' and 'c' in dict: print('ok')` you will get a True, since everything is true. if you `if 'a' and 'g' and 'c' in dict: print('ok')` you

[issue32599] Add dtrace hook for PyCFunction_Call

2019-12-28 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: +nanjekyejoannah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39123] PyThread_xxx() not available when using limited API

2019-12-28 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- nosy: +nanjekyejoannah, vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue33944] Deprecate and remove pth files

2019-12-28 Thread Michel Desmoulin
Michel Desmoulin added the comment: Just realized it didn't work in venv anyway. -- ___ Python tracker ___ ___ Python-bugs-list

[issue11105] Compiling evil ast crashes interpreter

2019-12-28 Thread Batuhan
Batuhan added the comment: We can probably implement something like this to prevent this happening diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index daac0966f5..f9da52da7f 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -559,6 +559,11 @@ class Obj2ModVisitor(PickleVisitor):

[issue11105] Compiling evil ast crashes interpreter

2019-12-28 Thread Batuhan
Change by Batuhan : -- versions: +Python 3.9 -Python 3.2, Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > I think we only need about 5 bits to store the age of each object , do we > really need to increase the object back to two word per object ? 5 bit *per object* is a lot because it scales with the number of objects. It will quickly obliterate any

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: > What threshold is this? > This is the different thresholds for the generations that you can get using > gc.get_threshold(). >They are in relationship to the number of objects in > every generation (there are slightly different >rules for the latest >

[issue39144] Align ctags and etags targets and include Python stdlib

2019-12-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > What threshold is this? This is the different thresholds for the generations that you can get using gc.get_threshold(). They are in relationship to the number of objects in every generation (there are slightly different rules for the latest

[issue39142] logging.config.dictConfig will convert namedtuple to ConvertingTuple

2019-12-28 Thread Henrique
Henrique added the comment: Sorry for not sending a proper reproducible script when submitting the issue. End of the day and quite frustrated with the bug, anyway, I attached a full script that will show the error. This is the custom handler I used: class MyHandler(logging.StreamHandler):

[issue39143] Implementing sub-generation steps in the gc

2019-12-28 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: > The most common reason is that when promotions of the youngest generations > happen, >some very young objects that just arrived in the generation are >promoted >because we have >reached a threshold, and its death will be >delayed. What threshold is

[issue39134] can't construct dataclass as ABC (or runtime check as data protocol)

2019-12-28 Thread Alexander Hirner
Alexander Hirner added the comment: We construct a computational graph and need to validate (or search for possible new) edges at runtime. The data is specific to computer vision. One example is clipping geometry within 2D boundaries. A minimal implementation of this data would be:

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Pablo's analysis. And this can't be backported, since it's a new feature. So I'm closing this issue. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue32438] PyLong_ API cleanup

2019-12-28 Thread Mark Dickinson
Mark Dickinson added the comment: Closing as a duplicate of #36048 (which isn't quite right, since this issue came first, but it's probably close enough). -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Deprecate implicit truncating when

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2019-12-28 Thread Mark Dickinson
Mark Dickinson added the comment: Serhiy: any thoughts about what version should be targeted for eventual removal of the functionality deprecated in this PR? 3.10? -- ___ Python tracker

[issue32438] PyLong_ API cleanup

2019-12-28 Thread Mark Dickinson
Mark Dickinson added the comment: @Batuhan: I think so, yes; at least, the "deprecated" part is done. The "eventually removed" is not, and I don't know whether we have a target version for that removal. -- ___ Python tracker

[issue35143] `from __future__ import annotations` has no effect inside `ast.parse`

2019-12-28 Thread Kay Hayen
Kay Hayen added the comment: Thanks a lot, Batuhan, this will feel a lot more correct, from my point of view, this could be closed unless there would be a backport. -- ___ Python tracker

[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2019-12-28 Thread Alex Grönholm
Change by Alex Grönholm : -- components: +asyncio nosy: +yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39148] DatagramProtocol + IPv6 does not work with ProactorEventLoop

2019-12-28 Thread Alex Grönholm
New submission from Alex Grönholm : Receiving a UDP datagram using DatagramProtocol on the Proactor event loop results in error_received() being called with WinError 87 (Invalid Parameter). The low-level sock_recv() works fine, but naturally loses the sender address information. The attached

[issue39145] Innocuous parent class changes multiple inheritance MRO

2019-12-28 Thread Cyker Way
Cyker Way added the comment: Ahhh, 1 second, I haven't really quit from this. I could open another thread but it's highly related to this one. I just came up with something that looks like a bug not a feature in the original c3. #!/usr/bin/env python3 #A C #

[issue39145] Innocuous parent class changes multiple inheritance MRO

2019-12-28 Thread Cyker Way
Cyker Way added the comment: Thank you for the links. I doubt this c3 variant could break EPG consistency making it c2. May run some tests later and move on to discussion board. Guess I'm done here. -- ___ Python tracker

[issue38938] Possible performance improvement for heaqq.merge()

2019-12-28 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +17174 pull_request: https://github.com/python/cpython/pull/17729 ___ Python tracker ___

[issue39147] using zipfile with root privilege shows FileNotFoundError

2019-12-28 Thread Patrick Liu
New submission from Patrick Liu : When I run the python script with root privilege, it can clone the repo successfully but with the error message as follow. However, it runs correctly with normal user. Why it cannot find the html file? Thanks. Python 3.7.4 (default, Aug 13 2019, 20:35:49)

[issue39146] too much memory consumption in re.compile unicode

2019-12-28 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +17172 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17728 ___ Python tracker ___

[issue39146] too much memory consumption in re.compile unicode

2019-12-28 Thread Zhipeng Xie
Change by Zhipeng Xie <775350...@qq.com>: -- title: to much memory consumption in re.compile unicode -> too much memory consumption in re.compile unicode ___ Python tracker

[issue39146] to much memory consumption in re.compile unicode

2019-12-28 Thread Zhipeng Xie
New submission from Zhipeng Xie <775350...@qq.com>: when running the following script, we found python2 comsume a lot memory while python3 does not have the issue. import re import time NON_PRINTABLE = re.compile(u'[^\U0001-\U0010]') time.sleep( 30 ) python2: PID USER PR NI

[issue37446] Undefined behavior in Python/hamt.c

2019-12-28 Thread Batuhan
Batuhan added the comment: > I don't get that output on 3.8.0a4+ I guess it is related with you didn't added -fsanitize=undefined option. -- nosy: +BTaskaya ___ Python tracker

[issue37446] Undefined behavior in Python/hamt.c

2019-12-28 Thread Batuhan
Change by Batuhan : -- keywords: +patch pull_requests: +17171 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17727 ___ Python tracker ___

[issue32438] PyLong_ API cleanup

2019-12-28 Thread Batuhan
Batuhan added the comment: Is this related/resolved with issue 36048? -- nosy: +BTaskaya ___ Python tracker ___ ___

[issue39112] Misleading documentation for tuple

2019-12-28 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks Terry, I guess it's a duplicate of issue34118 . -- ___ Python tracker ___ ___