[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c96d1546b11b4c282a7e21737cb1f5d16349656d by Serhiy Storchaka in branch 'main': bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939) https://github.com/p

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Similar to 45461, but with "raw-unicode-escape". When an incremental decoder gets a part of escape sequence (\u or \U) it raises an exception or return a bare "\" if it was the only part instead of keeping it until get

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string ___ Python tracker <https://bugs.pyt

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27232 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28944 ___ Python tracker <https://bugs.python.org/issu

[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27233 pull_request: https://github.com/python/cpython/pull/28945 ___ Python tracker <https://bugs.python.org/issue45

[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How would it be used from Python? What are scenarios? -- ___ Python tracker <https://bugs.python.org/issue45452> ___ ___

[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And what's next? -- ___ Python tracker <https://bugs.python.org/issue45452> ___ ___ Python-bugs-list mailing list

[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am interesting how these gdbm_failure_atomic() and gdbm_latest_snapshot() can be used in user code. Some real world examples. They look very low-level and requiring an additional boilerplate code to be useful if I understand it correctly

[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please show examples. -- ___ Python tracker <https://bugs.python.org/issue45452> ___ ___ Python-bugs-list mailing list Unsub

[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0bff4ccbfd3297b0adf690655d3e9ddb0033bc69 by Miss Islington (bot) in branch '3.10': [3.10] bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939) (GH-28943) https://github.com/p

[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7c722e32bf582108680f49983cf01eaed710ddb9 by Serhiy Storchaka in branch '3.9': [3.9] bpo-45461: Fix IncrementalDecoder and StreamReader in the "unicode-escape" codec (GH-28939) (GH-28945) https://github.com/p

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 39aa98346d5dd8ac591a7cafb467af21c53f1e5d by Serhiy Storchaka in branch 'main': bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944) https://github.com/p

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27240 pull_request: https://github.com/python/cpython/pull/28952 ___ Python tracker <https://bugs.python.org/issue45

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27241 pull_request: https://github.com/python/cpython/pull/28953 ___ Python tracker <https://bugs.python.org/issue45

[issue45452] Support crash tolerance feature for gdbm module

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Examples of using the new feature. -- ___ Python tracker <https://bugs.python.org/issue45452> ___ ___ Python-bugs-list mailin

[issue45461] UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 8191: \ at end of string

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

[issue45462] Speed up re.match with pre-compiled patterns

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Calling re.math() with a pre-compiled pattern is an uncommon case. Common cases are calling re.math() with a string pattern and calling the math() method of a pre-compiled pattern. Your change speeds up an uncommon case but slows down a common case

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4641afef661e6a22bc64194bd334b161c95edfe2 by Serhiy Storchaka in branch '3.10': [3.10] bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944) (GH-28952) https://github.com/p

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

2021-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 684860280687561f6312e206c4ccfbe4baa17e89 by Serhiy Storchaka in branch '3.9': bpo-45467: Fix IncrementalDecoder and StreamReader in the "raw-unicode-escape" codec (GH-28944) (GH-28953) https://github.com/p

[issue45472] Add public C API for partial "unicode-escape" and "raw-unicode-escape" decoding

2021-10-14 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed PR adds C API functions PyUnicode_DecodeUnicodeEscapeStateful() and PyUnicode_DecodeRawUnicodeEscapeStateful() for partially decoding with "unicode-escape" and "raw-unicode-escape" encodings. It were the only multibyte t

[issue45472] Add public C API for partial "unicode-escape" and "raw-unicode-escape" decoding

2021-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27244 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28955 ___ Python tracker <https://bugs.python.org/issu

[issue45467] Fix incremental decoder and stream reader in the "raw-unicode-escape" codec

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

[issue44105] tempfile.TemporaryDirectory deleted after sleep in threads

2021-10-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45462] Speed up re.match with pre-compiled patterns

2021-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And compare it with pat.match("asdf"). If the performance is critical, use methods of pre-compiled patterns. -- ___ Python tracker <https://bugs.python.o

[issue45462] Speed up re.match with pre-compiled patterns

2021-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For reference, caching was introduced in b1aa19515ffdb84c6633ee0344196fd8bd50ade0 21 years ago, and initially it checked for pre-compiled patterns before looking up in the cache. But it was changed 2 months later in

[issue45428] py_compile fails to read filenames from stdin

2021-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 59a633d3e2071d65aa6638da5cf767a5c1310271 by Graham Inggs in branch 'main': bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848) https://github.com/python/cpython/commit/59a633d3e2071d65aa6638da5cf767

[issue32596] Lazy import concurrent.futures.process and thread

2021-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What are issues with using global variable as import target? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue32

[issue45428] py_compile fails to read filenames from stdin

2021-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Graham. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 ___ Python tracker <https://bugs.python.or

[issue44977] Deprecate delegation of int to __trunc__

2021-10-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Interpreter Core stage: -> needs patch title: Deprecate delegation of int to __trunc__? -> Deprecate delegation of int to __trunc__ versions: +Python 3.11 ___ Python tracker <https://bugs.p

[issue32596] Lazy import concurrent.futures.process and thread

2021-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Inada-san. My first intention when I seen this code was to simplify it, but then I have found that it was an intentional change. It may be easy to detect such code and raise a syntax warning or error. Or get rid of this limitation and allow

[issue43139] test_ttk test_compound, test_tk test_type fail with Tk 8.6.11.1

2021-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See PR 6578. We already faced a similar problem when test_winfo_rgb was added. We finally found test colors which behave consistently on all tested platforms. But it turns out that not on all. -- ___ Python

[issue45229] Always use unittest for collecting tests in regrtests

2021-10-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27272 pull_request: https://github.com/python/cpython/pull/28986 ___ Python tracker <https://bugs.python.org/issue45

[issue45496] Tkinter: test_winfo_rgb failure

2021-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And on what of them it is failed? -- ___ Python tracker <https://bugs.python.org/issue45496> ___ ___ Python-bugs-list mailin

[issue45497] Argparse: Refactor '%' interpolation to f-strings

2021-10-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Pure cosmetic changes are usually rejected. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45

[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-10-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it would help if we could enable some future feature globally by command line option or environment variable, without modifying all source files. It would allow users to quickly test their code base for compatibility with future changes. The

[issue45500] Rewrite test_dbm

2021-10-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : * Generate test classes at import time. It allows to filter them when run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v". * Create a database class in a new directory which will be removed after test. It guarantee

[issue45500] Rewrite test_dbm

2021-10-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27284 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29002 ___ Python tracker <https://bugs.python.org/issu

[issue45502] Fix test_shelve and make it discoverable

2021-10-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : test_shelve was intended to run some tests for all underlying dbm implementation, but since b17acad68ea21c60dbc2088644f2934032304628 (at May 2008) it runs them with the same implementation. The proposed PR fixes this regression and also makes

[issue45502] Fix test_shelve and make it discoverable

2021-10-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also it was only tested with pickle protocols 0, 1 and 2. Now it will be tested with all pickle protocols. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45502] Fix test_shelve and make it discoverable

2021-10-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27285 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29003 ___ Python tracker <https://bugs.python.org/issu

[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +Fix test_shelve and make it discoverable ___ Python tracker <https://bugs.python.org/issue45229> ___ ___ Python-bug

[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +Rewrite test_dbm ___ Python tracker <https://bugs.python.org/issue45229> ___ ___ Python-bugs-list mailin

[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27286 pull_request: https://github.com/python/cpython/pull/29004 ___ Python tracker <https://bugs.python.org/issue45

[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b3f0ceae919c1627094ff628c87184684a5cedd6 by Serhiy Storchaka in branch 'main': bpo-45229: Make test_http_cookiejar discoverable (GH-29004) https://github.com/python/cpython/commit/b3f0ceae919c1627094ff628c87184

[issue42222] Modernize integer test/conversion in randrange()

2021-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27294 pull_request: https://github.com/python/cpython/pull/29021 ___ Python tracker <https://bugs.python.org/issue42

[issue37295] Possible optimizations for math.comb()

2021-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27302 pull_request: https://github.com/python/cpython/pull/29030 ___ Python tracker <https://bugs.python.org/issue37

[issue37295] Possible optimizations for math.comb()

2021-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is more optimized PR inspired by PR 29020. It would be too long to explain how PR 29020 can be improved, so I write a new PR. Basically it implements Raymond's idea #1, but supports n>62 for smaller k. How to calculate limits: import math n

[issue45452] Support crash tolerance feature for gdbm module

2021-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The main concern is that it is not clear how to use this feature, and if it is not clear, it will not be used. I am not even sure that it is Pythonic, because I do not know how to use it. For example, can it be used to implement transactions? How it works

[issue37295] Possible optimizations for math.comb()

2021-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Microbenchmarks: $ ./python -m pyperf timeit -s 'from math import comb' '[comb(n, k) for n in range(63) for k in range(n+1)]' Mean +- std dev: 1.57 ms +- 0.07 ms -> 209 us +- 11 us: 7.53x faster $ ./python -m pyperf timeit -s '

[issue45459] Limited API support for Py_buffer

2021-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Py_buffer is often used for handling arguments if the function supports bytes, bytearray and other bytes-like objects. For example bytes.partition(). Any additional memory allocation would add significant overhead here. bytes.join() creates Py_buffer for

[issue19459] Python does not support the GEORGIAN-PS charset

2021-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Possible solutions (they can be combined): 1. Add support for the GEORGIAN-PS charset and all other encodings used in libc (issue22679). The problem is that it is difficult to get the official information about these encodings. 2. Falls back to utf-8 or

[issue45436] test_tk.test_configure_type() failed on x86 Gentoo Non-Debug with X 3.x

2021-10-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27336 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29002 ___ Python tracker <https://bugs.python.org/issu

[issue45500] Rewrite test_dbm

2021-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Ɓukasz and Dong-hee Na. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45459] Limited API support for Py_buffer

2021-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not like requirement to allocate Py_buffer on the heap. It adds an overhead. Common case in CPython code is: Py_buffer view; void *buf; Py_ssize_t len; PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE); buf = view.buf; len = view.len; // no other fi

[issue45459] Limited API support for Py_buffer

2021-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: That would be an unfair advantage. If we want people to use the limited API we should not make it much slower than the non-limited API. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45531] field "mro" behaves strangely in dataclass

2021-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In Enum it is just implicitly forbidden: >>> from enum import * >>> class A(Enum): ... mro = 1 ... x = 2 ... Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/enum.py

[issue45535] Enum's dir() does not contain inherited members

2021-10-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : For example: >>> from enum import * >>> class E(IntEnum): ... x = 1 ... >>> dir(E) ['__class__', '__doc__', '__members__', '__module__', 'x'] >>> E.from_by

[issue37295] Possible optimizations for math.comb()

2021-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Divide-and-conquer approach works pretty well for larger n. For results slightly out of the 64-bit range: $ ./python -m pyperf timeit -s 'from math import comb' 'comb(63, 31)' Mean +- std dev: 2.80 us +- 0.14 us -> 388 ns +- 19 ns: 7

[issue37295] Possible optimizations for math.comb()

2021-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27356 pull_request: https://github.com/python/cpython/pull/29090 ___ Python tracker <https://bugs.python.org/issue37

[issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11

2021-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27365 pull_request: https://github.com/python/cpython/pull/29003 ___ Python tracker <https://bugs.python.org/issue45

[issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11

2021-10-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27366 pull_request: https://github.com/python/cpython/pull/28986 ___ Python tracker <https://bugs.python.org/issue45

[issue37295] Possible optimizations for math.comb()

2021-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And with optimization of math.perm() for small arguments: $ ./python -m pyperf timeit -s 'from math import perm' 'perm(30, 14)' Mean +- std dev: 524 ns +- 43 ns -> 66.7 ns +- 4.6 ns: 7.85x faster $ ./python -m pyperf timeit -s '

[issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long

2021-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sure. -- resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45311] Threading Semaphore and BoundedSemaphore release method implementation improvement

2021-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This code was added in bpo-10978. Raymond, what are your thoughts? -- nosy: +rhettinger versions: +Python 3.11 -Python 3.9 ___ Python tracker <https://bugs.python.org/issue45

[issue45542] Using multiple comparison operators can cause performance issues

2021-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree with Tim. The idea of optimizing stack manipulation operations for constants is interesting, but is it common enough case to justify the compiler complication? See also rejected issue27236. -- nosy: +serhiy.storchaka

[issue45556] uuid.uuid4() fast optimization

2021-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: random.getrandbits() is cryptographically weaker than os.urandom(). -- nosy: +rhettinger, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45

[issue45535] Enum's dir() does not contain inherited members

2021-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There may be a simple error (superfluous .__class__), but I am not sure. BTW, why use mro() instead of __mro__? Most code use __mro__. -- ___ Python tracker <https://bugs.python.org/issue45

[issue44970] Re-examine complex pow special case handling

2021-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is not it a duplicate of issue15996? -- ___ Python tracker <https://bugs.python.org/issue44970> ___ ___ Python-bugs-list m

[issue45531] field "mro" behaves strangely in dataclass

2021-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Where does dataclasses call mro()? -- ___ Python tracker <https://bugs.python.org/issue45531> ___ ___ Python-bugs-list mailin

[issue45531] field "mro" behaves strangely in dataclass

2021-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be more correct to look at cls.__dict__[fieldname]? BTW, mro() cannot be builtin, because you should be able to override it in some classes. -- ___ Python tracker <https://bugs.python.org/issue45

[issue45579] [list.append(i) for i in list] causes high resources usage

2021-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is expected behavior. Your code is equivalent to: _result = [] for i in your_list: _result.append(your_list.append(i)) which is equivalent to: _result = [] _j = 0 while _j < len(your_list): i = your_list[_j] _result.append(your_list.app

[issue45588] cached_method similar to cached_property to cache with classes

2021-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The simple implementation is: def cached_method(func): return cached_property(lambda self: lru_cache()(partial(func, self))) -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two ways to fix the larger issue. 1. Make issubclass(types.GenericAlias, type) returning True, and also make isinstance(typing.List[int], type) returning True and issubclass(typing._GenericAlias, type) returning True, and analyze every place in

[issue45436] test_tk.test_configure_type() fails with Tcl/Tk 8.6.11

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are there changes in handling empty values for other options? If yes, we perhaps need to add version-dependent tests for empty values instead of just skipping this case. -- ___ Python tracker <ht

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Two years is not so long for a bug. We fixed 8-year and 12-year bugs. The issue is that this feature is internally inconsistent (isinstance() is not consistent with issubclass()), the C implementation of list[int] is not consistent with the Python

[issue45605] Return False from __contains__ method if object not hashable for set and dict

2021-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue18510. It was also discussed on the Python-Dev mailing list (maybe more than once). If you have some new arguments or something in past 8 years made the old arguments no longer valid please open a new discussion on the mailing

[issue44904] Classmethod properties are erroneously "called" in multiple modules

2021-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b1302abcc8a4be5f39b4d60a1ce28032b77655b3 by Alex Waygood in branch 'main': bpo-44904: Fix classmethod property bug in doctest module (GH-28838) https://github.com/python/cpython/commit/b1302abcc8a4be5f39b4d60a1ce280

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > issubclass(x, list[int]) rejects the second argument for reasons explained in > the PEP. 1. One problem is that isinstance(x, type) != issubclass(type(x), type) if x is list[int]. It is unprecedented, I cannot recall any other case in which isin

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue40296. -- ___ Python tracker <https://bugs.python.org/issue45438> ___ ___ Python-bugs-list mailing list Unsub

[issue45662] Incorrect repr of InitVar of a type alias

2021-10-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The repr of InitVar preserves type aliases from the typing module, but not builtin. >>> import typing, dataclasses >>> dataclasses.InitVar[typing.List[int]] dataclasses.InitVar[typing.List[int]] >>> dataclasses.InitVar[list[int

[issue45662] Incorrect repr of InitVar of a type alias

2021-10-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29291 ___ Python tracker <https://bugs.python.org/issu

[issue45663] is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias

2021-10-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : >>> import dataclasses, types >>> @dataclasses.dataclass ... class A(types.GenericAlias): ... origin: type ... args: type ... >>> dataclasses.is_dataclass(A) True >>> a = A(list, int) >&g

[issue45663] is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias

2021-10-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27557 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29294 ___ Python tracker <https://bugs.python.org/issu

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : resolve_bases() returns incorrect result: >>> import types >>> types.resolve_bases((list[int],)) (list[int],) Expected (list,). new_class() fails: >>> types.new_class('L', (list[int],), {}) Traceback (most rec

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +27562 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29298 ___ Python tracker <https://bugs.python.org/issu

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -27569 ___ Python tracker <https://bugs.python.org/issue45664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: -27570 ___ Python tracker <https://bugs.python.org/issue45664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45665] Problems caused by isinstance(list[int]) returning True

2021-10-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : This is a meta-issue for problems caused by isinstance(list[int]) returning True. See also discussion in issue45438. -- components: Library (Lib) messages: 405290 nosy: serhiy.storchaka priority: normal severity: normal status: open title

[issue45665] Problems caused by isinstance(list[int]) returning True

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: isinstance(x, type) returns True for instances of types.GenericAlias (like list[int]). While it may help in some cases related to typing, in many unrelated cases it causes problems if the value which is not a type passes checks for types. Also

[issue45438] inspect not capturing type annotations created by __class_getitem__

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have opened separate issues for different cases and a meta-issue45665 for general discussion. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.11

[issue45355] Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the code unit

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

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27574 pull_request: https://github.com/python/cpython/pull/29305 ___ Python tracker <https://bugs.python.org/issue45

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6b867022d926be9fcc6f8038fb1093ba8c348ca5 by Serhiy Storchaka in branch '3.10': [3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305) https://github.com/python/cpython/commit/6b867022d926be9fcc6f8038fb1093

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +27575 pull_request: https://github.com/python/cpython/pull/29306 ___ Python tracker <https://bugs.python.org/issue45

[issue45502] Fix test_shelve and make it discoverable

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a043706f907e82ee6a562005991ff0b896a4e64d by Serhiy Storchaka in branch '3.9': [3.9] [3.10] bpo-45502: Fix test_shelve (GH-29003) (GH-29305) (GH-29306) https://github.com/python/cpython/commit/a043706f907e82ee6a562005991ff0

[issue45502] Fix test_shelve and make it discoverable

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

[issue45665] Problems caused by isinstance(list[int], type) returning True

2021-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: Problems caused by isinstance(list[int]) returning True -> Problems caused by isinstance(list[int], type) returning True ___ Python tracker <https://bugs.python.org/issu

[issue45535] Enum's dir() does not contain inherited members

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 29316 looks complicated. First of all, why do Enum needs a custom __dir__? What is wrong with the default implementation? -- ___ Python tracker <https://bugs.python.org/issue45

[issue45671] str(CancelledError()) is empty

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Andrew. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45671> ___ ___ Python-bug

[issue45674] From Python 3.7, sre_parse.parse() do not create SubPattern instances that can be used to back reproduce original expression if containing non-capturing groups

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: sre_parse.parse() is an internal function and this behaviour is an implementation detail. This change enabled some optimizations which did not work with non-capturing groups before. It did not affect the matching itself. -- nosy

<    16   17   18   19   20   21   22   23   24   25   >