[issue38219] Optimize dict.__init__ and dict.update for dict argument

2019-09-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15859 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16268 ___ Python tracker <https://bugs.python.org/issu

[issue38222] pathlib Path objects should support __format__

2019-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Convert it to string first: print(f'path is: {path!s:>50}') -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.pytho

[issue38222] pathlib Path objects should support __format__

2019-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Initially, the default __format__ converted the object to str and passed format specifier to str.__format__. This is defined in PEP 3101: class object: def __format__(self, format_spec): return format(str(self), format_spec) But later we

[issue38223] Reorganize test_shutil

2019-09-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently most shutil tests are in a single class. Tests for the same function are partially grouped together and partially intermixed with other tests. This makes hard to find an appropriate place for adding new tests and increase risk of hiding test

[issue38223] Reorganize test_shutil

2019-09-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15866 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16281 ___ Python tracker <https://bugs.python.org/issu

[issue38205] Py_UNREACHABLE() no longer behaves as a function call

2019-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I prefer to keep it a macro. The compiler does not know that it is never executed, so it can generate a suboptimal code. While it is a macro, it can be made a no-op, or even with compiler-specific instructions like __builtin_unreachable. This can help the

[issue38222] pathlib Path objects should support __format__

2019-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Or use !s or !r. In some cases it may be even better to use both convertions: f'{str(path)!r:>50}'. This is all application specific, so I do not think we should rethink our old decision. Explicit is better

[issue38222] pathlib Path objects should support __format__

2019-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am -0 on this. It is a can of worms. Once we add a trivial __format__ in Path, we will need to handle numerous requests for adding a trivial __format__ in many other classes. It is better to teach users to use !s (and this works also on older Python

[issue38205] Py_UNREACHABLE() no longer behaves as a function call

2019-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: _Py_NO_RETURN is a promise that the code past the function is unreachable, not that the function call is unreachable. > I'm not sure how __builtin_unreachable could be used with Py_UNREACHABLE() > macro. In the release mode Py_UNREACHAB

[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can use a lambda instead of partial: squared = lambda x: pow(x, 2) Proposed names look meaningful. But after adding support of keyword arguments please compare performance of the old and the new functions. I expect that the difference will be

[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you. Could you please test simpler examples like pow(2, 3)? Please use the --duplicate option. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And pow(2.0, 3.0) please. -- ___ Python tracker <https://bugs.python.org/issue38237> ___ ___ Python-bugs-list mailin

[issue38237] Expose meaningful keyword arguments for pow()

2019-09-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Ammar! Nice work! -- ___ Python tracker <https://bugs.python.org/issue38237> ___ ___ Pytho

[issue38237] Expose meaningful keyword arguments for pow()

2019-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't it a new feature? Isn't it too later to add it to 3.8? -- nosy: +lukasz.langa status: closed -> open ___ Python tracker <https://bugs.pytho

[issue38237] Expose meaningful keyword arguments for pow()

2019-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for the explanation Raymond and sorry for the disturb. My mistake, I had not noticed the release manager's assent. -- ___ Python tracker <https://bugs.python.org/is

[issue27071] unittest.TestCase.assertCountEqual is a very misleading name

2019-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > 1. It seems that the 'list' call should be irrelevant. It is relevant. Counter({1: 2}) != Counter(list({1: 2})). -- ___ Python tracker <https://bugs.pytho

[issue38249] Optimize out Py_UNREACHABLE in the release mode

2019-09-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Py_UNREACHABLE is used to indicate that a specific point in the program cannot be reached, even if the compiler might otherwise think it can. This is exact the case for __builtin_unreachable in GCC and Clang. I propose to extend Py_UNREACHABLE() to

[issue38249] Optimize out Py_UNREACHABLE in the release mode

2019-09-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +15905 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16329 ___ Python tracker <https://bugs.python.org/issu

[issue38209] Simplify dataclasses.InitVar by using __class_getitem__()

2019-09-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b4d0b39a9b4cd203bcc5b236dc96456e9658119a by Serhiy Storchaka in branch 'master': bpo-38209: Simplify dataclasses.InitVar by using __class_getitem__(). (GH-16255) https://github.com/python/cpyt

[issue38256] binascii.crc32 is not 64-bit clean

2019-09-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +nadeem.vawda ___ Python tracker <https://bugs.python.org/issue38256> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38254] Pickle not deserializing an aiohttp ClientConnectorError exception as expected

2019-09-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: aiohttp is not the part of the standard Python library. Please use an appropriate bug tracker for reporting this issue. -- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -&g

[issue38252] micro-optimize ucs1lib_find_max_char in Windows 64-bit build

2019-09-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks like a good idea. Do you mind to create a PR? -- ___ Python tracker <https://bugs.python.org/issue38252> ___ ___

[issue36947] Fix 3.3.3.1 Metaclasses Documentation

2019-09-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: pending -> open title: [Good first issue] Fix 3.3.3.1 Metaclasses Documentation -> Fix 3.3.3.1 Metaclasses Documentation ___ Python tracker <https://bugs.python.org/i

[issue36947] [Good first issue] Fix 3.3.3.1 Metaclasses Documentation

2019-09-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not good first issue. The referred documentation is complex and needs deep knowledge of Python for changing. The original report was wrong. The original documentation is correct. Josh, do you think the documentation needs other changes, and if yes

[issue38241] Pickle with protocol=0 in python 3 does not produce a 'human-readable' format

2019-09-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Protocol 0 was initially ASCII, but it was changed since adding support for the unicode type (and bytearray uses the unicode representation for compatibility with Python 3). It is Latin1 now. And still mostly human-readable (except that some control

[issue38249] Optimize out Py_UNREACHABLE in the release mode

2019-09-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > What does __builtin_unreachable()? Does it nothing? Call abort()? It is more than does nothing. It gives a hint to the compiler, so it can optimize out checks that lead to this code. For example, in switch (k) { case 0: ... cas

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Length should be Py_ssize_t. Python does not support creating bytes objects larger than PY_SSIZE_T_MAX. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is okay. Just check that all platforms which support pread() (Linux, *BSD, macOS) pass the length as size_t instead of int. Windows does not always support length larger than 2 KiB, but it does not support pread() either

[issue38265] Update os.pread to accept the length type as size_t

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ad7736faf5b82a24374c601a72599adf29951080 by Serhiy Storchaka (Dong-hee Na) in branch 'master': bpo-38265: Update os.pread to accept the length type as Py_ssize_t. (GH-16359) https://github.com/python/cpyt

[issue32820] Add and document __format__ method for IPv[46]Address

2019-09-24 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15957 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/16378 ___ Python tracker <https://bugs.python.org/issu

[issue32820] Add and document __format__ method for IPv[46]Address

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 16378 simplifies the implementation. It also caches the compiled RE. Needed the documentation for the new feature. -- ___ Python tracker <https://bugs.python.org/issue32

[issue38219] Optimize dict.__init__ and dict.update for dict argument

2019-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f163aeaa8c15b806b622c9cb10bc1d2a6e034e24 by Serhiy Storchaka in branch 'master': bpo-38219: Optimize dict creating and updating by a dict. (GH-16268) https://github.com/python/cpython/commit/f163aeaa8c15b806b622c9cb10bc1d

[issue38219] Optimize dict.__init__ and dict.update for dict argument

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

[issue36947] Fix 3.3.3.1 Metaclasses Documentation

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

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I now have an access to Windows (I did not have it 5 years ago), so I'm going to finish this issue if I have a time. -- ___ Python tracker <https://bugs.python.org/is

[issue38268] Unclear definition of ceil, floor and trunc in documentation mathmodule.c

2019-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The word "integral" has also other meaning. This is a duplicate of issue26512. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Vocabulary: Using "integra

[issue38265] Update os.pread to accept the length type as size_t

2019-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because this looks rather as a new feature than a bug fix. We don't add new features in maintained versions. Always there is a risk of introducing a regression. We don't know what bugs are contained in 64-bit size support on different platform

[issue38265] Update os.pread to accept the length type as size_t

2019-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Or call pread() multiple times and concatenate results. -- ___ Python tracker <https://bugs.python.org/issue38265> ___ ___

[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 543a3951a1c96bae0ea839eacec71d3b1a563a10 by Serhiy Storchaka in branch 'master': bpo-38005: Remove support of string argument in InterpreterID(). (GH-16227) https://github.com/python/cpython/commit/543a3951a1c96bae0ea839eacec71d

[issue38281] "+" ignored when determining file mode in gzip.GzipFile.__init__

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, this is a breaking change, it will break the code that reads gzipped temporary files. Note also that even if this change be accepted, you could not use this feature until Python 3.9 be released. But you can write to temporary files in all Python

[issue28286] gzip guessing of mode is ambiguous

2019-09-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +15997 pull_request: https://github.com/python/cpython/pull/16417 ___ Python tracker <https://bugs.python.org/issue28

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Right, it is intended change. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38283> ___ ___

[issue38223] Reorganize test_shutil

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4f2eac04e4fee4d7d188ad2eeb0e610e3d7254bb by Serhiy Storchaka in branch 'master': bpo-38223: Reorganize test_shutil. (GH-16281) https://github.com/python/cpython/commit/4f2eac04e4fee4d7d188ad2eeb0e61

[issue38223] Reorganize test_shutil

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

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue12458 and issue34372. Related issues: issue34876, issue16806, issue31241. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, of course. We could keep f_lineno unchanged, despite the fact that its value can be wrong, and introduce f_lineno_new. Then we should change all code in the stdlib which uses f_lineno to use f_new_lineno, or rather, to keep absolute backward

[issue38283] sys._getframe(1).f_lineno changed behavior in 3.8

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, I do not know such workaround. At best, you can analyze the code object and get the line number of the next instruction. It may be the line past the last line of the function call, or be equal to it if the function call is the part of complex

[issue38278] Need a more efficient way to perform dict.get(key, default)

2019-09-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Was LOAD_METHOD optimized for builtin methods? -- ___ Python tracker <https://bugs.python.org/issue38278> ___ ___ Python-bug

[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But the property object is not atomic. It's attribute __doc__ is writeable. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/is

[issue32820] Add and document __format__ method for IPv[46]Address

2019-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5d6f5b629394066a5249af25cc01f1a1f0edc138 by Serhiy Storchaka in branch 'master': bpo-32820: Simplify __format__ implementation for ipaddress. (GH-16378) https://github.com/python/cpython/commit/5d6f5b629394066a5249af25cc01f1

[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is deliberate. "/" and ":" do not have special meaning in regular expressions and do not need escaping. re.escape() now produces more human-readable result and works faster. -- nos

[issue38294] re.escape no longer escapes "/" or ":"

2019-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is already documented. There are even examples which contain "/" and ":". -- ___ Python tracker <https://bug

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

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

[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16134 pull_request: https://github.com/python/cpython/pull/16545 ___ Python tracker <https://bugs.python.org/issue22

[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 16545 solves the problem by using OS specific methods for converting between Python and Tcl strings. It is not ideal, but is good enough for most real cases. Now you can paste, copy and print non-BMP characters. The code containing them can be displayed

[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker <https://bugs.python.org/issue22214> ___ ___ Pytho

[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oops, it is better to attach it to issue13153. -- ___ Python tracker <https://bugs.python.org/issue22214> ___ ___ Python-bug

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16135 pull_request: https://github.com/python/cpython/pull/16545 ___ Python tracker <https://bugs.python.org/issue13

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 16545 solves the problem by using OS specific methods for converting between Python and Tcl strings. It is not ideal, but is good enough for most real cases. Now you can paste, copy and print non-BMP characters. The code containing them can be displayed

[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- Removed message: https://bugs.python.org/msg353760 ___ Python tracker <https://bugs.python.org/issue22214> ___ ___ Python-bug

[issue22214] Tkinter: Don't stringify callback arguments

2019-10-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- Removed message: https://bugs.python.org/msg353759 ___ Python tracker <https://bugs.python.org/issue22214> ___ ___ Python-bug

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I did not test the last version on Windows. There was a bug which caused using the Linux version on Windows. Now it should be fixed. -- ___ Python tracker <https://bugs.python.org/issue13

[issue38350] ./configure --with-pydebug should use -O0 rather than -Og

2019-10-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The purpose of using -Og is that it significantly speeds up tests. You can always pass CFLAGS="-O0" if you debug particular debugger issues, but in normal cases -Og looks more beneficial. It saves hours of time of common

[issue38348] Make python -m ast more configurable

2019-10-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why do you need this feature? -- ___ Python tracker <https://bugs.python.org/issue38348> ___ ___ Python-bugs-list mailin

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >From the point of view of Tk, the astral character "💻" looks like either two >invisible characters "\ud83d\udcbb" or as four characters "ð\x9f\x92»" (two of >them are invisible). Thus this breaks editing the physic

[issue38358] ASSERTION ERROR WHILE USING TENSORFLOW

2019-10-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a tracker for bugs in Python itself. Tensorflow is a third-party library. Please use an appropriate bug tracker for reporting issues with tensorflow. -- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your example Terry. There was one dubious place which I did not change because I did not know how to trigger the execution of it. Now the clipboard is fixed. -- ___ Python tracker <ht

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the result of new tests? python.bat -m test -v -uall test_tk -m test_clipboard* -- ___ Python tracker <https://bugs.python.org/issue13

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 06cb94bc8419b9a24df6b0d724fcd8e40c6971d6 by Serhiy Storchaka in branch 'master': bpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545) https://github.com/python/cpyt

[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-10-04 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-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed by PR 16545 (see issue13153). -- nosy: +serhiy.storchaka resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Mostly fixed by PR 16545 (see issue13153). The original example is now passed. >>> raise Exception('\U0001f603') Traceback (most recent call last): File "", line 1, in raise Exception('\U0001f603') Exception: 😃

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

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was fixed for all valid Unicode characters, you can still get an error when print a surrogate character to the stderr on Linux: >>> import sys >>> print('\ud800', file=sys.stderr) Traceback (most recent call last): Fi

[issue21084] IDLE can't deal with characters above the range (U+0000-U+FFFF)

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed by PR 16545 (see issue13153). -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue30019] IDLE freezes when opening a file with astral characters

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks like a duplicate of issue21084. Fixed by PR 16545 (see issue13153). It is virtually Eryk's workaround, but at the Tkinter level. -- resolution: -> fixed stage: needs patch -> resolved status: ope

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

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

[issue38371] Tkinter: deprecate the split() method

2019-10-04 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The tkapp.split() method has weird behavior. It splits a string recursively, so the type of items and the depth of nesting depends on spaces in string values. For example: >>> import tkinter >>> root = tkinter.Tcl() >>&

[issue38371] Tkinter: deprecate the split() method

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

[issue38328] Speed up the creation time of constant list literals.

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Great! I withdrew the original proposition in issue33325 because the part of the optimization was not so good as I expected. But this part is good. $ ./python -m timeit "[$(seq -s, 10)]" 500 loops, best of 5: 75.5 nsec per loop $ ./python

[issue38348] Make python -m ast more configurable

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I do not understand you. typed_ast does not have such features as multiline dump() and CLI. What relation is this have with the --type-comments flag? As for fitting tree into the terminal width, the current indentation is 3 spaces. Changing it to

[issue38328] Speed up the creation time of constant list literals.

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Okay, but first I want to solve an issue with list overallocation. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38373] List overallocation strategy

2019-10-04 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently list uses the following formula for allocating an array for items (if size != 0): allocated = size + (size >> 3) + (3 if size < 9 else 6) If add items by 1 the growth pattern is: 0, 4, 8, 16, 25, 35, 46, 58, 72, 88, ... I t

[issue38373] List overallocation strategy

2019-10-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is some data. step is the number of items added at a time, the first row is the size, the second row is the currently allocated size, the third row is the proposed allocated size. for step in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10): sizes0 = range(step

[issue33714] module can set an exception in tp_clear

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

[issue38335] simplify overlaps function in ipaddress.py

2019-10-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the benefit of your version? -- ___ Python tracker <https://bugs.python.org/issue38335> ___ ___ Python-bugs-list m

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

2019-10-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : os.sendfile() has a keyword-or-positional parameter named "in". Since it is a keyword in Python, it is not possible to pass it as a keyword argument. You can only pass it as a positional argument or using a var-keyword argument (unlikely an

[issue38381] Possible wordcode optimization for STORE/LOAD pairs

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I thought about this. But STORE_FAST x is followed by LOAD_FAST x just by accident. If you change the expression (1+x**2 or f(x**2)) they no longer be neighbors. I am not sure this pattern is common enough. There are more common pairs. Also, note that

[issue38210] Intersection of dict view with iterator returns empty set

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c38e725d17537b20ff090b1b5ec7db1820ff9b63 by Serhiy Storchaka (Dong-hee Na) in branch 'master': bpo-38210: Fix intersection operation with dict view and iterator. (GH-16602) https://github.com/python/cpyt

[issue38210] Intersection of dict view with iterator returns empty set

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

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 24ddd9c2d6ab61cbce7e68d6de36d4df9bd2c3fb by Serhiy Storchaka (Hai Shi) in branch 'master': bpo-38383: Fix possible integer overflow in startswith() of bytes and bytearray. (GH-16603) https://github.com/python/cpyt

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

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

[issue38384] An assertion failure in test_pickle

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not understand how you got an assertion failure. Did you interrupt tests with Ctrl-C? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue38

[issue38210] Intersection of dict view with iterator returns empty set

2019-10-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was added. Do you mean any special? -- ___ Python tracker <https://bugs.python.org/issue38210> ___ ___ Python-bugs-list m

[issue25988] collections.abc.Indexable

2019-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ef092fe9905f61ca27889092ca1248a11aa74498 by Serhiy Storchaka in branch 'master': bpo-25988: Do not expose abstract collection classes in the collections module. (GH-10596) https://github.com/python/cpyt

[issue38215] Do not import modules in star-import when __all__ is not defined.

2019-10-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> rejected 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-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +16202 pull_request: https://github.com/python/cpython/pull/16613 ___ Python tracker <https://bugs.python.org/issue28

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

2019-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a simpler way to fix this issue. Instead of hacking __new__, the inheritance registry can be set up in ABCMeta.__init__. There are no reasons of making this in __new__. -- versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.4, Python

[issue38390] Got a compile warning in dictobject.c

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

[issue25988] collections.abc.Indexable

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

[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It could be possible to do this in backward compatible way. PyObject_GC_Track() could add the object to the list of new objects (all objects are already linked in bi-linked list, so it would need to just move the object to the specified list), and

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