[issue37295] Possible optimizations for math.comb()

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think Raymond means extending the tables to TableSize=101. It can benefit larger arguments if move the code in perm_comb_small(). And perhaps loops in perm_comb_small() could be optimized by using precalculated values for some products

[issue46191] Conflict between using annotations in singledispatch() and MyPy

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Okay. As a workaround we can explicitly specify the dispatching type: @f.register(list) def _(a: list[int]) -> None: pass -- resolution: -> rejected stage: -> resolved status: open -> closed __

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

2021-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8d7644fa64213207b8dc6f555cb8a02bfabeced2 by andrei kulakov in branch 'main': bpo-45853: Fix misspelling and unused import in pathlib (GH-30292) https://github.com/python/cpython/commit/8d7644fa64213207b8dc6f555cb8a0

[issue45853] Misspelled _IGNORED_ERROS in Lib/pathlib.py

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

[issue46200] Discourage logging f-strings due to security considerations

2021-12-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vinay.sajip ___ Python tracker <https://bugs.python.org/issue46200> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46189] Text containing "wide" character not correctly refreshed

2021-12-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37295] Possible optimizations for math.comb()

2021-12-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +28518 pull_request: https://github.com/python/cpython/pull/30305 ___ Python tracker <https://bugs.python.org/issue37

[issue37295] Possible optimizations for math.comb()

2021-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 30305 applies Mark's algorithm for larger n (up to 127) depending on k, as was suggested by Raymond. Note that it uses different table for limits, which maps k to maximal n. -- ___ Python tracker &

[issue46142] python --help output is too long

2021-12-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that the man page should contain all details related to the CLI (and may be even some examples). -- ___ Python tracker <https://bugs.python.org/issue46

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are other issues with the documentation of splitext(). 1. It uses term "extension" (it is even a part of function name), but it is vague and usually does not include a period. On Windows the extension of "python.exe" is "

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well, so we can keep term "extension". But I think it is worth to clarify that "leading periods" is related to the last component, not the whole path. It is related to the original issue. -- __

[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is better to not change posixpath for now. And it is not necessary. But shutil.rmtree() needs to support file descriptors, and it is not trivial issue. -- ___ Python tracker <https://bugs.python.

[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-03 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : It is necessary in particularly for supporting dir_fd in the tempfile module (issue25927). -- components: Library (Lib) messages: 409599 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Add support for dir_fd in

[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-01-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +Add support for dir_fd in shutil.rmtree() ___ Python tracker <https://bugs.python.org/issue25927> ___ ___ Pytho

[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +28596 pull_request: https://github.com/python/cpython/pull/30365 ___ Python tracker <https://bugs.python.org/issue46

[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am sorry, I implemented this feature before opening this issue, but due to typo the PR was not linked here. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46187] Optionally support rounding for math.isqrt()

2022-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is i, rem = isqrt_rem(n) i + (rem != 0) better than (isqrt(n<<2) + 1) >> 1 or n and isqrt(n-1) + 1 ? As for use cases, there were few cases in my experience when I needed the ceiling square root, mostly in simple experiments

[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have also almost finished this issue (only needed to add some tests and docs). -- ___ Python tracker <https://bugs.python.org/issue25

[issue46181] Destroying an expaned Combobox prevents Entry focus until Alt+Tab

2022-01-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2022-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My plan was to fix as much bugs in the stdlib and backport workaround to 3.9 and 3.10, then propose to revert this "feature" in 3.11. There is a risk of introducing some regressions by this change, but we can handle it. I think it is better to

[issue44024] Improve the TypeError message for non-string second arguments passed to the built-in functions getattr and hasattr

2022-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good point. That code was originally added in issue420304 because every exception raised in PyObject_GetAttr() (including a TypeError for non-string name) was silenced in hasattr() and 3-argument getattr(). It was changed in Python 3, so this code

[issue34178] test_tcl fails on the 3.7 branch

2022-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was a bug fix. msg320663 states that that issue needs a more complex fix than provided by the initial patch. And that more complex fix was applied. It looks to me that this issue is caused by running new tests with old stdlib. Tests caught a bug in an

[issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR

2022-01-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If you are looking for case-insensitive string comparison, look at locale.strcoll() and locale.strxfrm(). They are locale-aware. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46

[issue46280] About vulnerabilities in Cpython native code

2022-01-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The CPython source code is irregularly scanned by different code analysis tools. The results shown extremely high quality of code in comparison with other open source and proprietary code. Most of reports are false positive. Last time real bugs (2 or 3

[issue46293] Typo in specifying escape sequence

2022-01-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, it is a backslash following by a newline. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46

[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: A warning is an indication of possible bugs in your code. If you do not close file explicitly, and it is closed by the garbage collector, the time of closing is undeterminated. This can lead to exhausting of file descriptors if you have a lot of opened

[issue46303] _Py_stat and _Py_wstat using incorrect type for status argument

2022-01-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +vstinner ___ Python tracker <https://bugs.python.org/issue46303> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The safe way of using read_lines() is: lines = read_lines() try: # use lines finally: lines.close() or with contextlib.closing(read_lines()) as lines: # use lines And it is in no way better than using "with

[issue37295] Possible optimizations for math.comb()

2022-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2d787971c65b005d0cce219399b9a8e2b70d4ef4 by Serhiy Storchaka in branch 'main': bpo-37295: Use constant-time comb() and perm() for larger n depending on k (GH-30305) https://github.com/python/cpyt

[issue46312] range() function could accept slice() objects as parameters

2022-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Accepting a slice directly in the range constructor is ambiguous. What to do if start or stop are negative or None? What if stop is less than start? You need to specify a sequence length to handle these cases. Maybe the following expressions work for you

[issue46307] string.Template should allow inspection of identifiers

2022-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What are the use cases for this feature? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46

[issue46307] string.Template should allow inspection of identifiers

2022-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The simplest way of collecting template names is to use a defaultdict: >>> d = collections.defaultdict(str) >>> string.Template('$a $b').substitute(d) ' ' >>> d.keys() dict_keys(['a', 'b&#x

[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +mark.dickinson, rhettinger, stutzbach, tim.peters ___ Python tracker <https://bugs.python.org/issue46407> ___ ___ Pytho

[issue46408] signal module wrongly relies on small int singletons

2022-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See msg234768 and issue23325. I propose to close this as a duplicate of issue23325. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46

[issue46393] Generate frozenset constants when explicitly appropriate

2022-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As Steven have noted the compiler-time optimization is not applicable here because name frozenset is resolved at run-time. In these cases where a set of constants can be replaced with a frozenset of constants (in "x in {1,2,3}" and in "

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1292aa6db5bed889a3c87df443754fcae0177801 by Nikita Sobolev in branch 'main': bpo-46425: Fix direct invocation of multiple test modules (GH-30666) https://github.com/python/cpython/commit/1292aa6db5bed889a3c87df443754f

[issue46426] Improve tests for the dir_fd argument

2022-01-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There is a flaw in tests for the dir_fd argument in test_posix. All these tests open a current directory as dir_fd, so all paths are relative to the current directory. They will pass in case of the following errors: 1. dir_fd, src_dir_fd or dst_dir_fd

[issue46426] Improve tests for the dir_fd argument

2022-01-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +28868 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30668 ___ Python tracker <https://bugs.python.org/issu

[issue20823] [doc] Clarify copyreg.pickle() documentation

2022-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 65940fa5c12a4b4a0650c7845044ffd63b94e227 by Kumar Aditya in branch 'main': bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) https://github.com/python/cpython/commit/65940fa5c12a4b4a0650c7845044ff

[issue46045] NetBSD: do not use POSIX semaphores

2022-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 60ceedbdd5b5fb22803039a59954798d931f659a by Thomas Klausner in branch 'main': bpo-46045: Do not use POSIX semaphores on NetBSD (GH-30047) https://github.com/python/cpython/commit/60ceedbdd5b5fb22803039a59954798d931f659a -

[issue44024] Improve the TypeError message for non-string second arguments passed to the built-in functions getattr and hasattr

2022-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 16bf9bd157c7bf5f9c60414fa8e0fe5047c55a9b by Géry Ogam in branch 'main': bpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863) https://github.com/python/cpython/commit/16bf9bd157c7bf5f9c60414fa8e0fe

[issue44024] Improve the TypeError message for non-string second arguments passed to the built-in functions getattr and hasattr

2022-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Géry. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37295] Possible optimizations for math.comb()

2022-01-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: All this should be tested with the C implementation because relative cost of operations is different in C and Python. I have tested Raymond's idea about using iterative algorithm for small k. $ ./python -m timeit -s 'from math import comb'

[issue37295] Possible optimizations for math.comb()

2022-01-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: comb(n, k) can be computed as perm(n, k) // factorial(k). $ ./python -m timeit -r1 -n1 -s 'from math import comb' "comb(100, 50)" recursive: 1 loop, best of 1: 9.16 sec per loop iterative: 1 loop, best of 1: 164 sec per loop

[issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers

2022-01-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I share concerns of Inada-san. I also think that keeping a status quo (ignoring the mapping attribute in typing) is the lesser evil. I am not sure that exposing this attribute was a good idea. We do not expose attributes list and index for list iterators

[issue46444] Wrong value of pi for larger values using math.cos() function

2022-01-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Arguments of cos() and sin() should be in radians, not in degrees. So the correct formulas are k*cos(pi/2-pi/k) and k*sin(pi/k). They are useless because to find the pi approximation you need to know pi. -- nosy: +serhiy.storchaka resolution

[issue46444] Wrong value of pi for larger values using math.cos() function

2022-01-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, math.radians() just multiplies its argument by pi/180. And what is your issue? -- ___ Python tracker <https://bugs.python.org/issue46

[issue45767] Fix types for dev_t processing in posix module

2022-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is device number -1 used in any context (for example as "unknown device number")? -- ___ Python tracker <https://bugs.python.o

[issue23325] Turn SIG_DFL and SIG_IGN into functions

2022-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It may take a time, because the module initialization code has been completely rewritten. -- ___ Python tracker <https://bugs.python.org/issue23

[issue46425] Multiple test modules fail to run if invoked directly

2022-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 22f73bd9f1fc573d5c998f345b66c29f7ca6614d by Nikita Sobolev in branch 'main': bpo-46425: Fix direct invocation of `test_contextlib` (GH-30681) https://github.com/python/cpython/commit/22f73bd9f1fc573d5c998f345b66c2

[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2022-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset cfadcc31ea84617b1c73022ce54d4ae831333e8d by andrei kulakov in branch 'main': bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283) https://github.com/python/cpython/commit/cfadcc31ea84617b1c73022ce54d4a

[issue30512] CAN Socket support for NetBSD

2022-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 40fcd16889028bd3cd2289e0f8a2af43f17a5824 by Thomas Klausner in branch 'main': bpo-30512: Add CAN Socket support for NetBSD (GH-30066) https://github.com/python/cpython/commit/40fcd16889028bd3cd2289e0f8a2af

[issue30512] CAN Socket support for NetBSD

2022-01-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.7 ___ Python tracker <https://bugs.python.or

[issue46426] Improve tests for the dir_fd argument

2022-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 54610bb448a9cf5be77d53b66169fca4c11be6cb by Serhiy Storchaka in branch 'main': bpo-46426: Improve tests for the dir_fd argument (GH-30668) https://github.com/python/cpython/commit/54610bb448a9cf5be77d53b66169fc

[issue46426] Improve tests for the dir_fd argument

2022-01-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +28944 pull_request: https://github.com/python/cpython/pull/30757 ___ Python tracker <https://bugs.python.org/issue46

[issue46426] Improve tests for the dir_fd argument

2022-01-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a1015c6478e8cbec2ecb984a3cba733783d168b5 by Miss Islington (bot) in branch '3.10': bpo-46426: Improve tests for the dir_fd argument (GH-30668) (GH-30739) https://github.com/python/cpython/commit/a1015c6478e8cbec2ecb984a3cba73

[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why __class_getitem__ was added in PurePath at first place? PurePath should not be a generic class, unlike to os.PathLike. For os.PathLike the type parameters represent the returning type of os.fspath() (either str or bytes), but the pathlib module only

[issue46376] PyMapping_Check returns 1 for list

2022-01-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is difficult to distinguish Mapping from Sequence because they have the same set of dunder methods. The difference is only in semantic -- __iter__ yields items for Sequence and keys for Mapping, __getitem__ gets an item by index (or a sequence by slice

[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2022-01-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 94d6434ba7ec3e4b154e515c5583b0b665ab0b09 by Miss Islington (bot) in branch '3.9': [3.9] bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283) (GH-30738) https://github.com/python/cpyt

[issue21987] TarFile.getmember on directory requires trailing slash iff over 100 chars

2022-01-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5 ___ Python tracker <https://bugs.python.or

[issue46157] Typo in JSON documentation

2022-01-24 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.or

[issue46500] make timeit module accept files

2022-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This module provides a simple way to time small bits of Python code. What problem are you trying to solve. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46

[issue46426] Improve tests for the dir_fd argument

2022-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3f1ea163ea54513e00e0e9d5442fee1b639825cc by Serhiy Storchaka in branch '3.9': [3.9] bpo-46426: Improve tests for the dir_fd argument (GH-30668) (GH-30757) https://github.com/python/cpython/commit/3f1ea163ea54513e00e0e9d5442fee

[issue46426] Improve tests for the dir_fd argument

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

[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-01-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not related to email and asyncio either. -- components: -asyncio, email ___ Python tracker <https://bugs.python.org/issue46

[issue46544] `textwrap.TextWrapper` leaks two intermediate vars into class namespace

2022-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 82bce54614f8116a40454fbbbf96a3fd460ca7df by Nikita Sobolev in branch 'main': bpo-46544: Do not leak `x` and `uspace` in textwrap.TextWrapper (GH-30955) https://github.com/python/cpython/commit/82bce54614f8116a40454fbbbf96a3

[issue44791] Substitution of ParamSpec in Concatenate

2022-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ecfacc362dd7fef7715dcd94f2e2ca6c622ef115 by Serhiy Storchaka in branch 'main': bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518) https://github.com/python/cpyt

[issue44791] Substitution of ParamSpec in Concatenate

2022-01-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29147 pull_request: https://github.com/python/cpython/pull/30969 ___ Python tracker <https://bugs.python.org/issue44

[issue44791] Substitution of ParamSpec in Concatenate

2022-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 27518 fixes a substitution of a ParamSpec variable with a Concatenate nad a list of types. It is not specified explicitly in PEP 612, but it does not contradict it. PR 30969 makes an ellipsis be valid as the last argument of Concatenate to fix a

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it should be closed for the same reasons as #35095. It is not common enough case to complicate Path.write_text(), and you always can use open()+write(). -- nosy: +serhiy.storchaka ___ Python tracker

[issue46500] make timeit module accept files

2022-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Usually, when you benchmark a non-trivial piece of code, you need also to specify a setup code. If the benchmarked code is large enough to be read from a file, the setup code should be read from a file too. The common practice is to write the benchmarked

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: True is a keyword which is compiled to expression whose value is True, 𝕋𝕣𝕦𝕖 is an identifier which refers to the builtin variable "True" which has a value True by default. You can change the value of a builtin variable, but the value of expre

[issue41416] Restore default implementation of __ne__ in mixins Set and Mapping

2022-01-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29195 pull_request: https://github.com/python/cpython/pull/21628 ___ Python tracker <https://bugs.python.org/issue41

[issue46555] Unicode-mangled names refer inconsistently to constants

2022-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: https://docs.python.org/3/library/constants.html#built-in-constants -- ___ Python tracker <https://bugs.python.org/issue46

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is nothing wrong with writing two lines of code. And two lines of code may be more readable than one line of code. New method or parameter has a cost -- core developers need to maintain it, update documentation and tests if they conflict with new

[issue46615] Use-after-free by mutating set during set operations

2022-02-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46615> ___ ___ Python-bugs-list mailing list Unsub

[issue46610] assertCountEqual doesn't work as expected for dictionary elements

2022-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Eric and Raymond. -- nosy: +serhiy.storchaka resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46565] Delete module-level loop variables when no longer needed

2022-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0cbdd2131195b0d313762968f604e80a3e65ca9f by Nikita Sobolev in branch 'main': bpo-46565: `del` loop vars that are leaking into module namespaces (GH-30993) https://github.com/python/cpython/commit/0cbdd2131195b0d313762968f604e8

[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

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

[issue46483] `pathlib.PurePath.__class_getitem__` does not return `GenericAlias`

2022-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7ffe7ba30fc051014977c6f393c51e57e71a6648 by Nikita Sobolev in branch 'main': bpo-46483: Remove `__class_getitem__` from `pathlib.PurePath` (GH-30848) https://github.com/python/cpython/commit/7ffe7ba30fc051014977c6f393c51e

[issue44977] Deprecate delegation of int to __trunc__

2022-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b4bd1e1422997de61faf506b4916e83013bc7d21 by Zackery Spytz in branch 'main': bpo-44977: Deprecate delegation of int to __trunc__ (GH-31031) https://github.com/python/cpython/commit/b4bd1e1422997de61faf506b4916e8

[issue44977] Deprecate delegation of int to __trunc__

2022-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Zackery. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It does not have a use case of T[int] in mind. It is an implementation detail which simplifies the code, makes runtime checks more strict and makes types.GenericAlias more similar to typing._GenericAlias. For example, currently: >>> A = List

[issue46639] Ceil division with math.ceildiv

2022-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue31978. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46639> ___ ___ Python-bug

[issue42353] Proposal: re.prefixmatch method (alias for re.match)

2022-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not convinced. What are examples of using re.match() instead of re.search()? How common is this type of errors? There are perhaps many millions of scripts which use re.match(), deprecating re.match() at any time in future would be very destructive

[issue41259] Find adverbs is not correct on the documentation

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

[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29321 pull_request: https://github.com/python/cpython/pull/31143 ___ Python tracker <https://bugs.python.org/issue44

[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have created an alternative PR 31143 which adds special method __typing_subst__ in TypeVar and ParamSpec instead of __parameters__ and __getitem__. It has almost the same effect except making TypeVar and ParamSpec and subscriptable. The Python code in

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There were two reasons of accepting arbitrary callables in _type_check(): 1. NewType() returned a function. 2. xml.etree.cElementTree.Element was a function in Python 2. Now NewType is a class, and Python 2 no longer supported. I agree that we should get

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29332 pull_request: https://github.com/python/cpython/pull/31159 ___ Python tracker <https://bugs.python.org/issue46

[issue46642] typing: tested TypeVar instance subclass TypeError is incidental

2022-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that instances of most other types are non-subclassable "by accident". >>> class A(42): pass ... Traceback (most recent call last): File "", line 1, in TypeError: int() takes at most 2 arguments (3 given) >>&

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, List[42] is not currently accepted. >>> List[42] Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 318, in inner return func(*args, **kwds)

[issue46644] typing: remove callable() check from typing._type_check

2022-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But it gives the same result. What version of Python do you test with? -- ___ Python tracker <https://bugs.python.org/issue46

[issue46642] typing: tested TypeVar instance subclass TypeError is incidental

2022-02-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The test is good. If we accidentally make a TypeVar instance subclassable, it will catch such error. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46611] Improve coverage of `__instancecheck__` and `__subclasscheck__` methods in `typing.py`

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c1ff4cb98b11c00aee765019364544c71e7dd2df by Nikita Sobolev in branch '3.10': [3.10] bpo-46611: add coverage to instance and class checks in `typing.py` (GH-31078) (GH-31182) https://github.com/python/cpyt

[issue46611] Improve coverage of `__instancecheck__` and `__subclasscheck__` methods in `typing.py`

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Nikita. -- components: +Tests -Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 ___ Python tracker <https://bugs.python.or

[issue46674] Two if in a row in generators

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is valid syntax. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46674> ___ ___ Python-bug

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Round division would be useful not less than ceil division, if not more. In the stdlib it would be used in: 1. The datetime module. 2. Fraction.__round__. -- ___ Python tracker <https://bugs.python.

[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Extension Modules nosy: +serhiy.storchaka versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue45

<    1   2   3   4   5   6   7   8   9   10   >