[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >From documentation: .. c:function:: void PyObject_GC_Track(PyObject *op) Adds the object *op* to the set of container objects tracked by the collector. The collector can run at unexpected times so objects must be valid while being tracked. T

[issue37324] collections: remove deprecated aliases to ABC classes

2019-10-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> collections.abc.Indexable ___ Python tracker <https://bugs.python

[issue36953] Remove collections ABCs?

2019-10-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38396] ast.literal_eval doesn't give information about node except the type of it

2019-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have same doubts. See also issue32888. -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Improve exception message in ast.literal_eval ___ Py

[issue38294] Documentation on 3.6->3.7 re.escape no longer escaping "/" or ":" should be obvious

2019-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 15ae75d660befe643ed42eb2707a557cea97256c by Serhiy Storchaka (Ricardo Bánffy) in branch 'master': bpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442) https://github.com/python/cpyt

[issue38392] Ensure that objects entering the GC are valid

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am sure this will break third-party projects. But I thing that we should not revert this change, as it completely matches the documentation. It is good that it was applied so early at development cycle. Stefan, could you please test Cython and lxml with

[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Example: >>> from typing import NamedTuple >>> import pickle >>> class A: ... class B(NamedTuple): ... x: int ... >>> pickle.dumps(A.B) Traceback (most recent call last): File "", line 1, in _

[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +16226 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16641 ___ Python tracker <https://bugs.python.org/issu

[issue38406] Missed some public names in help(typing)

2019-10-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Special forms NoReturn, Final, Literal and class ForwardRef are not shown in the help() output. -- components: Library (Lib) messages: 354177 nosy: gvanrossum, levkivskyi, serhiy.storchaka priority: normal severity: normal status: open title

[issue38406] Missed some public names in help(typing)

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I looked at wrong Python version. -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : typing.SupportsXXX classes do not have docstrings and help() shows the docstring of the parent class instead, which is wrong ("Base class for protocol classes..."). -- components: Library (Lib) messages: 354179 nosy: gvanrossum,

[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +16227 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16644 ___ Python tracker <https://bugs.python.org/issu

[issue38371] Tkinter: deprecate the split() method

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d05b000c6bcd39dba4f4b2656e45954802649562 by Serhiy Storchaka in branch 'master': bpo-38371: Tkinter: deprecate the split() method. (GH-16584) https://github.com/python/cpython/commit/d05b000c6bcd39dba4f4b2656e4595

[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b690a2759e62d9ee0b6ea1b20e8f7e4b2cdbf8bb by Serhiy Storchaka in branch 'master': bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH-16583) https://github.com/python/cpyt

[issue38371] Tkinter: deprecate the split() method

2019-10-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36698] Shell restart when error message contains non-BMP characters

2019-10-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue22742] IDLE shows traceback when printing non-BMP character

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And with PR 16583 it is now completely fixed. I.e. it can only fail in cases when the regular interactive interpreter fails too. -- resolution: -> fixed stage: needs patch -> resolved status: open -&g

[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8252c52e57283515ace5d4251584255dc5c60eb5 by Serhiy Storchaka in branch 'master': bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644) https://github.com/python/cpython/commit/8252c52e57283515ace5d425158425

[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 13abda41003daf599587991d8291f0dacf6e9519 by Serhiy Storchaka in branch 'master': bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641) https://github.com/python/cpython/commit/13abda41003daf599587991d8291f0

[issue38294] Documentation on 3.6->3.7 re.escape no longer escaping "/" or ":" should be obvious

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 43f5c0c4d0a608c04c3978adb45117f3943203b7 by Serhiy Storchaka (Ricardo Bánffy) in branch '3.7': [3.7] bpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442) (GH-16647) https://github.com/python/cpyt

[issue38414] Ordering a nested dictionary in python with json format

2019-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Dictionary preserve the insertion order starting from Python 3.7 (actually from 3.6, but it was not guarantied). I am surprised that you got different result in 3.6. I cannot reproduce it. In older Python versions you can pass object_pairs_hook

[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16254 pull_request: https://github.com/python/cpython/pull/16673 ___ Python tracker <https://bugs.python.org/issue38

[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16255 pull_request: https://github.com/python/cpython/pull/16674 ___ Python tracker <https://bugs.python.org/issue38

[issue38294] Documentation on 3.6->3.7 re.escape no longer escaping "/" or ":" should be obvious

2019-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Ricardo! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 87db4d343c9609137f6e62aa3595db610a33842c by Serhiy Storchaka in branch '3.7': [3.7] bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641). (GH-16674) https://github.com/python/cpyt

[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0b354fc2bfe1a4624551907df396ed36ea8bf4ca by Serhiy Storchaka in branch '3.7': [3.7] bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644). (GH-16673) https://github.com/python/cpyt

[issue38407] Add docstrings for typing.SupportsXXX classes

2019-10-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38405] Nested subclasses of typing.NamedTuple are not pickleable

2019-10-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16287 pull_request: https://github.com/python/cpython/pull/16701 ___ Python tracker <https://bugs.python.org/issue38

[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, Samuel already made a PR. Then I withdraw PR 16701. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38

[issue38436] Improved performance for list addition.

2019-10-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How often do you need to add three or more lists in comparison with other uses of the "+" operator? How larger is the benefit of this optimization? How much it slows down other uses of the "+" operator? Would be nice if you provide

[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : It likely happened when it was edited on Windows. -- assignee: docs@python components: Documentation messages: 354428 nosy: docs@python, lukasz.langa, serhiy.storchaka priority: normal severity: normal status: open title: Doc/whatsnew/3.8.rst has

[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +16293 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16715 ___ Python tracker <https://bugs.python.org/issu

[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset cbb548130caf24275fa16100bccc537570cb46df by Serhiy Storchaka in branch 'master': bpo-38442: Remove an execution bit from Doc/whatsnew/3.8.rst. (GH-16715) https://github.com/python/cpython/commit/cbb548130caf24275fa16100bccc53

[issue38442] Doc/whatsnew/3.8.rst has an execution bit

2019-10-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Strange, it was only in master. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.8 ___ Python tracker <https://bugs.python.or

[issue38432] ZeroDivisionError when inf is expected

2019-10-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See https://en.wikipedia.org/wiki/Denormal_number. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38

[issue38445] os.path.exists() takes bool as argument and returns True

2019-10-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Eryk, I think testing for bool in _fd_converter and issuing a warning is a good idea. Do you want to create a PR? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38

[issue38424] typing.Generator shorthand

2019-10-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is already documented, with examples. I do not think the documentation can be made better. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38

[issue38436] Improved performance for list addition.

2019-10-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I do not see any significant change in + operator timing on my machine > (again, just a rough test): Because the time includes the time of iterating, which can be significant in comparison with adding two integers. Please use the pyperf modul

[issue38378] os.sendfile() has improperly named parameter

2019-10-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +16319 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16742 ___ Python tracker <https://bugs.python.org/issu

[issue38378] os.sendfile() has improperly named parameter

2019-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 140a7d1f3579e778656a6b6bfad72489e9870a4d by Serhiy Storchaka in branch 'master': bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742) https://github.com/python/cpython/commit/140a7d1f35

[issue38378] os.sendfile() has improperly named parameter

2019-10-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 14166 now fixes the issue in more generic way. It skips one additional frame when type.__new__ is called not directly from type.__call__. -- ___ Python tracker <https://bugs.python.org/issue28

[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 793cb85437299a3da3d74fe65480d720af330cbb by Serhiy Storchaka (Samuel Colvin) in branch 'master': bpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702) https://github.com/python/cpyt

[issue38202] A fatal error in test_dictviews

2019-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b16e382c446d76ede22780b15c75f43c5f132e25 by Serhiy Storchaka (Zackery Spytz) in branch 'master': bpo-38202: Fix a crash in dict_view & non-itearble. (GH-16241) https://github.com/python/cpython/commit/b16e382c446d76ede22780b15c

[issue38202] A fatal error in test_dictviews

2019-10-13 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38431] dataclasses.InitVar breaks with typing.Optional

2019-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Samuel! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37759] Polish whatsnew for 3.8

2019-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16338 pull_request: https://github.com/python/cpython/pull/16769 ___ Python tracker <https://bugs.python.org/issue37

[issue38482] BUG in codecs.BufferedIncrementalDecoder

2019-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The first argument of iterdecode() should be an iterable of bytes objects, not a bytes object. Try codecs.iterdecode([enc], 'utf-8') -- nosy: +serhiy.storchaka ___ Python tracker <https://bu

[issue38474] digit check logic can be replaced by Py_ISDIGIT on prepare_s

2019-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the benefit of such change? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38

[issue38485] BUG Modules/_io/texio.c

2019-10-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +IO nosy: +benjamin.peterson, stutzbach type: -> behavior versions: +Python 2.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

[issue38474] digit check logic can be replaced by Py_ISDIGIT on prepare_s

2019-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was added as a replacement of locale aware isdigit(). It was initially used only for implementing bytes.isdigit() and in PyOS_ascii_strtod(). isdigit() is not used in Modules/_struct.c, so there is nothing to replace with Py_ISDIGIT(). Currently

[issue38474] digit check logic can be replaced by Py_ISDIGIT on prepare_s

2019-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I left this on to the struct module maintainers. -- nosy: +mark.dickinson, meador.inge ___ Python tracker <https://bugs.python.org/issue38

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2019-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just discovered that the assignment operator leaks variables out of comprehensions. >>> [(j:=i*i)+1/j for i in range(1, 3)] [2.0, 4.25] >>> j 4 >>> g = ((j:=i*i*i)+1/j for i in range(1, 3)) >>> list(g) [2.0, 8.125] >

[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2019-10-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16365 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16814 ___ Python tracker <https://bugs.python.org/issu

[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Mikko. Yes, the heuristic used in Python 3 is unable to catch all inconsistencies in using tabs and spaces. Such bug was already reported early. There should be an open issue. -- nosy: +serhiy.storchaka

[issue38495] print built-in function docs bug

2019-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe just explain defaults in the text? Print *objects* to the text stream *file* (the standard output by default), separated by *sep* (a space by default) and followed by *end* (a newline by default). -- nosy: +serhiy.storchaka

[issue38493] os.CLD_KILLED should be implemented

2019-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about CLD_STOPPED? For reference, other CLD_* constants were added in issue10812. -- nosy: +rosslagerwall, serhiy.storchaka versions: +Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.

[issue38499] Add rmtree() to pathlib.Path

2019-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Karthikeyan. pathlib.Path provides an object oriented interface to file path operations and to low-level filesystem operations. rmtree() is a high-level and complex operation. Instead of adding more and more complex operations to the Path

[issue38194] Consistently add exist_ok / missing_ok parameters to directory creation/deletion functions

2019-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: os.mkdir() and os.rmdir() are wrappers around corresponding system calls. I do not think they should have additional parameters, especially for functionality which can be easily achieved by wrapping the call with the try/except block. For shutil.rmtree

[issue38494] Add assert_not_called_with

2019-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you know why there is assertRaises(), but there is no assertNotRaises()? Because assertNotRaises(Exception, callable, *args, **kwargs) would be equivalent to just callable(*args, **kwargs). Call the function, and if is raised an exception, the test

[issue38508] Tracing events anomaly when creating a multi-line list

2019-10-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Considering the code as: x = { 1, 2 } It first gets constant 1. Then gets constant 2. Then build a set. Then assign it to the variable. Obviously that the variable is assigned at line 1, so you would get a backward line in any case. The set display is

[issue38507] Improve the documentation of the nested list initialization

2019-10-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is already documented. See note 2 at https://docs.python.org/3/library/stdtypes.html#common-sequence-operations. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38

[issue38465] The type of ob_exports in PyByteArrayObject become Py_ssize_t.

2019-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also array and mmap. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38465> ___ ___ Pytho

[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2019-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why this ABI is exported at all? These functions are only used in the sys module, why they are defined in ceval.c instead of be static functions in sysmodule.c? -- nosy: +serhiy.storchaka ___ Python tracker

[issue32758] Stack overflow when parse long expression to AST

2019-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8eb27cc35489848596d9fb4b1c91fac00ae75d21 by Serhiy Storchaka (Ashley Whetter) in branch '2.7': bpo-32758: Warn that compile() can crash when compiling to an AST object (GH-6043) (GH-16566) https://github.com/python/cpyt

[issue32758] Stack overflow when parse long expression to AST

2019-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset dedb99acdb5bbc179872235f975248133d3fb440 by Serhiy Storchaka (Ashley Whetter) in branch '2.7': bpo-32758: Warn that ast.parse() and ast.literal_eval() can segfault the interpreter (GH-5960) (GH-16565) https://github.com/python/cpyt

[issue32758] Stack overflow when parse long expression to AST

2019-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38513] Should we maintain Jython related code?

2019-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think such kind of questions should be asked on Python-Dev. Even the 2.7 stdlib and tests are not completely compatible with Jython. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +carljm, ncoghlan ___ Python tracker <https://bugs.python.org/issue38524> ___ ___ Python-bugs-list mailing list Unsub

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You have to call __set_name__() if you create a cached_property dynamically outside of the class namespace. p = cached_property(age) p.__set_name__(cls, 'age3') cls.age3 = p (And setattr() is not needed here.) -- nosy: +serhiy

[issue38524] functools.cached_property is not supported for setattr

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue38517. For now we need to better document the use of __set_name__ with cached_property. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The proposed fix fixes a crash, but there is other bug in iterating shared dicts. class A: def __init__(self, x, y): if x: self.x = x if y: self.y = y a = A(1, 2) print(list(iter(a.__dict__))) print(list(reversed(a.__dict__))) b = A(1

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: AFAIK there is existing issue for this idea. I have doubts about performance. I added _PyObject_LookupAttr in particularly to avoid an overhead of raising and silencing an AttributeError. I believe most performance sensitive code in the core now uses it

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am surprised that it was SO expensive. Pathlib would largely benefit from cached_property if it be compatible with slots. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why private? They should be public. But the problem is that making a reference to the object we can prolong its lifetime and even create a reference loop. There was a proposition to create a weak reference, but not all types support weak reference

[issue38530] Offer suggestions on AttributeError

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue18156, issue22716 and PEP 473. -- ___ Python tracker <https://bugs.python.org/issue38530> ___ ___ Python-bugs-list m

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be better to change an AttributeError to TypeError? Seems this is the only place in the core when missing special method causes an AttributeError and not TypeError. -- nosy: +serhiy.storchaka

[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2019-10-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue31202> ___ ___ Python-bugs-list mailing list Unsub

[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2019-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +16406 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16860 ___ Python tracker <https://bugs.python.org/issu

[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +16407 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16861 ___ Python tracker <https://bugs.python.org/issu

[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.9 -Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue38535> ___ ___ Python-bugs-list m

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There are possible leaks in PyArg_Parse and similar functions for format units "es#" and "et#". Macros STORE_SIZE and (since 3.8) FETCH_SIZE can leave the function despite there is an own reference to an encoded string (s). The le

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +16414 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16869 ___ Python tracker <https://bugs.python.org/issu

[issue38465] The type of ob_exports in PyByteArrayObject become Py_ssize_t.

2019-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 06cd5b6acd98205adae1a3ea4223e88f38ad55ab by Serhiy Storchaka (Hai Shi) in branch 'master': bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746) https://github.com/python/cpyt

[issue38465] The type of ob_exports in PyByteArrayObject become Py_ssize_t.

2019-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution hai shi! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38208] Simplify string.Template by using __init_subclass__()

2019-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 919f0bc8c904d3aa13eedb2dd1fe9c6b0555a591 by Serhiy Storchaka in branch 'master': bpo-38208: Simplify string.Template by using __init_subclass__(). (GH-16256) https://github.com/python/cpython/commit/919f0bc8c904d3aa13eedb2dd1fe9c

[issue38208] Simplify string.Template by using __init_subclass__()

2019-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue27961] remove support for platforms without "long long"

2019-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a9ed91e6c2f0f1a9960b1382321918448228a801 by Serhiy Storchaka (Sergey Fedoseev) in branch 'master': bpo-27961: Replace PY_LONG_LONG with long long. (GH-15386) https://github.com/python/cpython/commit/a9ed91e6c2f0f1a9960b1382321918

[issue38493] os.CLD_KILLED and os.CLD_STOPPED should be implemented

2019-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2eba6ad7bf3a5beeed54209a0107be8e1ac77767 by Serhiy Storchaka (Dong-hee Na) in branch 'master': bpo-38493: Add os.CLD_KILLED and os.CLD_STOPPED. (GH-16821) https://github.com/python/cpython/commit/2eba6ad7bf3a5beeed54209a0107be

[issue38493] os.CLD_KILLED and os.CLD_STOPPED should be implemented

2019-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Dong-hee! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5bc6a7c06eda20ba131ecba6752be0506d310181 by Serhiy Storchaka in branch 'master': bpo-38540: Fix possible leak in PyArg_Parse for "es#" and "et#". (GH-16869) https://github.com/python/cpython/commit/5bc6a7c06e

[issue38542] [2.7] Expose _PyGC_generation0 for allowing internal use directly from a CPython extension

2019-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is too late to add this feature in 2.7. See https://www.python.org/dev/peps/pep-0373/#release-schedule, the feature freeze was 9.5 years ago. -- nosy: +serhiy.storchaka ___ Python tracker <ht

[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2019-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 10ecbadb799ddf3393d1fc80119a3db14724d381 by Serhiy Storchaka in branch 'master': bpo-31202: Preserve case of literal parts in Path.glob() on Windows. (GH-16860) https://github.com/python/cpython/commit/10ecbadb799ddf3393d1fc80119a3d

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16421 pull_request: https://github.com/python/cpython/pull/16876 ___ Python tracker <https://bugs.python.org/issue38

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16422 pull_request: https://github.com/python/cpython/pull/16877 ___ Python tracker <https://bugs.python.org/issue38

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ccdfeb7e969bf3aafd43dbe6581c30f66f2b0890 by Serhiy Storchaka in branch '2.7': [2.7] bpo-38540: Fix possible leak in PyArg_Parse for "es#" and "et#". (GH-16869). (GH-16877) https://gi

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 928c68eee620cc6b624a195375143c2aa55644a4 by Serhiy Storchaka in branch '3.7': bpo-38540: Revert a warning if PY_SSIZE_T_CLEAN is not defined. (GH-16876) https://github.com/python/cpython/commit/928c68eee620cc6b624a195375143c

[issue38540] Possible leaks in PyArg_Parse for "es#" and "et#"

2019-10-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38555] Undefined behavior in dictreviter_iternext

2019-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The pointer can also go before the beginning of the array in a loop if i becomes 0. -- ___ Python tracker <https://bugs.python.org/issue38

<    4   5   6   7   8   9   10   11   12   13   >