[issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early

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

[issue47066] Convert a warning about flags not at the start of the regular expression into error

2022-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 92a6abf72e7a8274f96edbb5297119d4ff055be7 by Serhiy Storchaka in branch 'main': bpo-47066: Convert a warning about flags not at the start of the regular expression into error (GH-31994) https://github.com/python/cpython/commit

[issue47066] Convert a warning about flags not at the start of the regular expression into error

2022-03-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +30084 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31994 ___ Python tracker <https://bugs.python.org/issu

[issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early

2022-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4142961b9f5ad3bf93976a6a7162f8049e354018 by Serhiy Storchaka in branch 'main': bpo-39394: Improve warning message in the re module (GH-31988) https://github.com/python/cpython/commit/4142961b9f5ad3bf93976a6a7162f8049e354018

[issue47066] Convert a warning about flags not at the start of the regular expression into error

2022-03-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : This warning was introduced in 3.6. The reason is that in most other regular expression implementations global inline flags in the middle of the expression have different semantic: they affect only the part of the expression after the flag

[issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early

2022-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This warning was introduced in 3.6. It is a time to convert it into an error. RE error messages contain position. But I understand that very few users will use 3.11 in nearest future, so I am going to add a position to warning message and backport

[issue39394] re: DeprecationWarning for `flag not at the start of expression` is cutoff too early

2022-03-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +30079 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31988 ___ Python tracker <https://bugs.python.org/issu

[issue46410] TypeError when parsing regexp with unicode named character sequence escape

2022-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> import unicodedata >>> unicodedata.lookup('KEYCAP NUMBER SIGN') '#️' >>> print(ascii(unicodedata.lookup('KEYCAP NUMBER SIGN'))) '#\ufe0f\u20e3' Support of Unicode Named Character Sequences in the unicodeescape codec and in t

[issue433030] SRE: Atomic Grouping (?>...) is not supported

2022-03-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +mrabarnett priority: low -> normal ___ Python tracker <https://bugs.python.org/issue433030> ___ ___ Python-bugs-list mai

[issue47031] math.nan should note that NANs do not compare equal to anything

2022-03-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We cannot guarantee that NAN never equal to anything, because we can create an object equal to it. For example mock.ANY. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue47

[issue433030] SRE: Atomic Grouping (?>...) is not supported

2022-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +30072 pull_request: https://github.com/python/cpython/pull/31982 ___ Python tracker <https://bugs.python.org/issue433

[issue40296] help(list[int]) fails

2022-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a5b7678a67ac99edd50822827b772e7d9afc8e64 by Serhiy Storchaka in branch '3.10': [3.10] bpo-40296: Fix supporting generic aliases in pydoc (GH-30253). (GH-31976) https://github.com/python/cpython/commit/a5b7678a67ac99edd50822827b772e7d9afc8e64

[issue44405] add program passed as string to dis module.

2022-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Neither of tokenize, ast or symtable modules support passing the source string as argument. If add this feature in the dis module, we will need to add it in all other modules with similar CLI. I do not think it is practical. You always can pass the source

[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

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

[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2022-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4d2099f455229b10f88846dbe9fe6debbee55356 by Serhiy Storchaka in branch '3.9': [3.9] bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165) (GH-31979) https://github.com/python/cpython/commit

[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2022-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +30069 pull_request: https://github.com/python/cpython/pull/31979 ___ Python tracker <https://bugs.python.org/issue14

[issue40296] help(list[int]) fails

2022-03-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +30066 pull_request: https://github.com/python/cpython/pull/31976 ___ Python tracker <https://bugs.python.org/issue40

[issue47042] Fix test_html_doc in test_pydoc

2022-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is 3.11 only issue. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.or

[issue40296] help(list[int]) fails

2022-03-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset cd44afc573e2e2de8d7e5a9119c347373066cd10 by Serhiy Storchaka in branch 'main': bpo-40296: Fix supporting generic aliases in pydoc (GH-30253) https://github.com/python/cpython/commit/cd44afc573e2e2de8d7e5a9119c347373066cd10

[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: closed -> open ___ Python tracker <https://bugs.python.org/issue46996> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue47042] Fix test_html_doc in test_pydoc

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a5d246066b5352a7d72e70ec0acb643e7c0861fa by Serhiy Storchaka in branch 'main': bpo-47042: Fix testing the HTML output in test_pydoc (GH-31959) https://github.com/python/cpython/commit/a5d246066b5352a7d72e70ec0acb643e7c0861fa

[issue46996] Drop support of Tcl/Tk older than 8.5.12

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

[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: After PR 31839 has been merged you cannot build the _tkinter module with Tcl/Tk older than 8.5.12. If you will still try to run IDLE on such incomplete build, an import error during importing tkinter will be translated to IDLE error: $ ./python -m idlelib

[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, the previous message was written via a phone because of blackout, so the formatting is a tine bit messy. __slotnames__ is set in copyreg._slotnames(). If you want to keep a list of all slots you should save it in __slotnames__, either using copyreg

[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > > It is not set automatically. It is set in object.__reduce__ by calling > some helper function from the copyreg module. -- ___ Python tracker <https://bugs.python.or

[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: __slotnames__ is used for storing all slot names. New object.__getstate__() proposed in issue26579 may have some relation to this discussion. -- nosy: +serhiy.storchaka ___ Python tracker <ht

[issue46996] Drop support of Tcl/Tk older than 8.5.12

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

[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c2e3c06139e9468efb32629d147d99a1672d9e19 by Serhiy Storchaka in branch 'main': bpo-46996: Remove support of Tcl/Tk < 8.5.12 (GH-31839) https://github.com/python/cpython/commit/c2e3c06139e9468efb32629d147d99a1672d9

[issue40296] help(list[int]) fails

2022-03-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +Fix test_html_doc in test_pydoc ___ Python tracker <https://bugs.python.org/issue40296> ___ ___ Python-bugs-list m

[issue47042] Fix test_html_doc in test_pydoc

2022-03-17 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +30048 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31959 ___ Python tracker <https://bugs.python.org/issu

[issue47042] Fix test_html_doc in test_pydoc

2022-03-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Due to missed splitlines() in test_pydoc the HTML output was not tested correctly. Instead of testing that the actual output contains every *line* from the expected output it tested that the actual output contains every *character* from the expected

[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 8.5.12 will be 10 years old at the time of releasing 3.11. We can relax the requirements for 8.5.x, so the code can be build with older versions, but some tests will fail because we removed workarounds for differences in behavior in older versions from

[issue46981] Empty typing.Tuple

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

[issue46981] Empty typing.Tuple

2022-03-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 15df8f8d89a0e563bdd15e4cd6734298736a5a1d by Serhiy Storchaka in branch 'main': bpo-46981: Remove typing._TypingEmpty (GH-31836) https://github.com/python/cpython/commit/15df8f8d89a0e563bdd15e4cd6734298736a5a1d

[issue45979] Fix Tkinter tests with old Tk

2022-03-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset dbbe4d2d0075fa0e95b069fb4780d79aae3514c7 by Serhiy Storchaka in branch 'main': bpo-45979: Fix Tkinter tests with old Tk (>= 8.5.12) (GH-31938) https://github.com/python/cpython/commit/dbbe4d2d0075fa0e95b069fb4780d79aae351

[issue30080] Add the --duplicate option for timeit

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

[issue45979] Fix Tkinter tests with old Tk

2022-03-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +30029 pull_request: https://github.com/python/cpython/pull/31938 ___ Python tracker <https://bugs.python.org/issue45

[issue45979] Fix Tkinter tests with old Tk

2022-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a great idea. I have opened issue46996 for this. -- ___ Python tracker <https://bugs.python.org/issue45979> ___ ___

[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Tkinter nosy: +christian.heimes, epaine, erlendaasland ___ Python tracker <https://bugs.python.org/issue46

[issue37907] speed-up PyLong_As*() for large longs

2022-03-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +mark.dickinson ___ Python tracker <https://bugs.python.org/issue37907> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +29938 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31839 ___ Python tracker <https://bugs.python.org/issu

[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-12 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : In issue45979 E. Paine suggested to drop support of Tcl/Tk older than 8.5.12 (8.5.12 was released on 2012-07-27 and 8.6.0 on 2012-12-20). Tkinter tests contain workarounds and special cases for older versions of Tcl/Tk, many of them can be removed. Also

[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-03-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 31143 simplified some code without changing the common API: Objects/genericaliasobject.c | 46 ++ 1 file changed, 14 insertions(+), 32 deletions(-) Lib/_collections_abc.py | 63

[issue46981] Empty typing.Tuple

2022-03-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If for repr(Tuple[()]), it is no longer needed. -- ___ Python tracker <https://bugs.python.org/issue46981> ___ ___ Python-bug

[issue46981] Empty typing.Tuple

2022-03-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +29934 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31836 ___ Python tracker <https://bugs.python.org/issu

[issue43224] Add support for PEP 646

2022-03-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29925 pull_request: https://github.com/python/cpython/pull/31828 ___ Python tracker <https://bugs.python.org/issue43

[issue43224] Add support for PEP 646

2022-03-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5b1b9eacb92dd47d10793a8868246df6ea477ed6 by Serhiy Storchaka in branch 'main': bpo-43224: Implement substitution of unpacked TypeVarTuple (GH-31800) https://github.com/python/cpython/commit/5b1b9eacb92dd47d10793a8868246df6ea477ed6

[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

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

[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-03-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3bc801960655ea265599805eac24173164b511a6 by Matt Bogosian in branch '3.10': [3.10] bpo-46581: Propagate private vars via _GenericAlias.copy_with (GH-31061) (GH-31821) https://github.com/python/cpython/commit

[issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec

2022-03-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b6a5d8590c4bfe4553d796b36af03bda8c0d5af5 by Serhiy Storchaka in branch 'main': bpo-44796: Unify TypeVar and ParamSpec substitution (GH-31143) https://github.com/python/cpython/commit/b6a5d8590c4bfe4553d796b36af03bda8c0d5af5

[issue35677] Do not automount in stat() by default

2022-03-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Glad to see that this old inconsistency was fixed. But seems that if we will add support for statx() we will need to set AT_NO_AUTOMOUNT by default. -- resolution: -> out of date stage: patch review -> resolved status: open -&g

[issue46982] Error in the experts list

2022-03-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : After adding experts for typing module, I get an error when try to submit changes: Error: property nosy: 'JelleZijlstra' is not a user. I think there is a typo in the experts list. -- messages: 414893 nosy: gvanrossum, kj, serhiy.storchaka

[issue46981] Empty typing.Tuple

2022-03-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There are two empty typing.Tuple. They have the same repr but are not equal. >>> from typing import * >>> t1 = Tuple[()] >>> t2 = t1.copy_with(()) >>> t1 typing.Tuple[()] >>> t2 typing.Tuple[()] >>>

[issue43224] Add support for PEP 646

2022-03-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka nosy_count: 8.0 -> 9.0 pull_requests: +29901 pull_request: https://github.com/python/cpython/pull/31800 ___ Python tracker <https://bugs.python.org/issu

[issue45767] Fix types for dev_t processing in posix module

2022-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 31794 supports NODEV and checks for integer overflows. -- ___ Python tracker <https://bugs.python.org/issue45767> ___ ___

[issue45767] Fix types for dev_t processing in posix module

2022-03-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29898 pull_request: https://github.com/python/cpython/pull/31794 ___ Python tracker <https://bugs.python.org/issue45

[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 32bf3597922ac3f613989582afa2bff43bea8a2f by Matt Bogosian in branch 'main': bpo-46581: Propagate private vars via _GenericAlias.copy_with (GH-31061) https://github.com/python/cpython/commit/32bf3597922ac3f613989582afa2bff43bea8a2f

[issue40280] Consider supporting emscripten/webassembly as a build target

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

[issue46972] Documentation: Reference says AssertionError is raised by `assert`, but not all AssertionErrors are.

2022-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Eric. The existing documentation looks pretty clear to me. Any exception can be raised explicitly, no need to repeat this. And unittest.TestCase methods do not raise AssertionError. They raise TestCase.failureException, which by default

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about mix-ins or abstract base classes? class VecMixin: def length(self): return math.hypot(*self) class Vec2D(NamedTuple, VecMixin): x: float y: float class Vec3D(NamedTuple, VecMixin): x: float y: float z: float

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

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two ways of supporting an open file descriptor to a directory: 1. Accept a file descriptor as the dir argument. 2. Add a new parameter dir_fd; dir will then be a path relative to dir_fd. The original proposition is option 2. PR 31785 implements

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

2022-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +29890 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31785 ___ Python tracker <https://bugs.python.org/issu

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

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

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

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 02fbaf4887deaf0207a5805d3736e0124a694c14 by Serhiy Storchaka in branch 'main': bpo-46245: Add optional parameter dir_fd in shutil.rmtree() (GH-30365) https://github.com/python/cpython/commit/02fbaf4887deaf0207a5805d3736e0124a694c14

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 31781 is a simple PR which enables multiple inheritance with NamedTuple. As a side effect, it adds support of generic NamedTuple. I am not sure that all details work as expected. It is easy to limit multiple inheritance only for Generic if needed

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +29887 pull_request: https://github.com/python/cpython/pull/31781 ___ Python tracker <https://bugs.python.org/issue43

[issue46953] use FASTCALL for __import__ builtin

2022-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the advantage of not touching a stable code? It was never a performance critical part of the code. This is why it avoided multiple previous optimizations. It is still use PyArg_ParseTupleAndKeywords(). Of course now, when optimization is provided

[issue46953] use FASTCALL for __import__ builtin

2022-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The recommended way is to use importlib.import_module(). -- ___ Python tracker <https://bugs.python.org/issue46953> ___ ___

[issue23325] Turn SIG_DFL and SIG_IGN into functions

2022-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree. There were too many changes in this code, and making SIG_DFL and SIG_IGN functions exposes some issues with sharing objects between interpreters. It is easier to keep them integers for now. -- ___ Python

[issue44439] stdlib wrongly uses len() for bytes-like object

2022-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 36dd7396fcd26d8bf9919d536d05d7000becbe5b by Ma Lin in branch 'main': bpo-44439: _ZipWriteFile.write() handle buffer protocol correctly (GH-29468) https://github.com/python/cpython/commit/36dd7396fcd26d8bf9919d536d05d7000becbe5b

[issue46947] unicodedata.name gives ValueError for control characters

2022-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue18234. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Unicodedata module should provide access to codep

[issue46953] use FASTCALL for __import__ builtin

2022-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: __import__() usually is not called directly, and in common case (when it is not overridden) the overhead of the call is avoided completely in the import statement. And in non-trivial case, it would only save 80 microseconds if you import 1000 modules. I

[issue43292] xml.ElementTree iterparse filehandle left open

2022-03-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed superseder: Add the close method for ElementTree.iterparse() object -> versions: +Python 3.10,

[issue43292] xml.ElementTree iterparse filehandle left open

2022-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 852d9b77abefcad2bb8d203e3ab9f2ca49ab305f by Miss Islington (bot) in branch '3.9': [3.9] bpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696) (GH-31720) https://github.com/python/cpython/commit

[issue46341] duplicate paragraphs - asyncio Coroutines and Tasks file

2022-03-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Fix incorrect use of directives in asyncio documentation ___ Python tracker <https://bugs.python

[issue43292] xml.ElementTree iterparse filehandle left open

2022-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 496c428de3318c9c5770937491b71dc3d3f18a6a by Jacob Walls in branch 'main': bpo-43292: Fix file leak in `ET.iterparse()` when not exhausted (GH-31696) https://github.com/python/cpython/commit/496c428de3318c9c5770937491b71dc3d3f18a6a

[issue14156] argparse.FileType for '-' doesn't work for a mode of 'rb'

2022-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset eafec26ae5327bb23b6dace2650b074c3327dfa0 by MojoVampire in branch 'main': bpo-14156: Make argparse.FileType work correctly for binary file modes when argument is '-' (GH-13165) https://github.com/python/cpython/commit

[issue46928] type.__qualname__ ignores module name in tp_name for static types

2022-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What do you expect? The full qualified name of the object is __module__ + '.' + __qualname__. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46

[issue46927] Improve error message for subscripting non-generic types

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

[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ab9301a28fa431d7a32163126fc96de3b2ce6107 by Serhiy Storchaka in branch 'main': bpo-46927: Include the type's name in the error message for subscripting non-generic types (GH-31694) https://github.com/python/cpython/commit

[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +29814 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31694 ___ Python tracker <https://bugs.python.org/issu

[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +gvanrossum, kj ___ Python tracker <https://bugs.python.org/issue46927> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently, if you try to subscript a non-generic type you will get an error: >>> int[str] Traceback (most recent call last): File "", line 1, in TypeError: 'type' object is not subscriptable Yes, 'type' objects are usually not subs

[issue44863] Allow TypedDict to inherit from Generics

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

[issue43923] Can't create generic NamedTuple as of py3.9

2022-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please don't revert all changes. It will not make it working right in any case. See issue44863 for more correct approach. -- ___ Python tracker <https://bugs.python.org/issue43

[issue46864] Deprecate ob_shash in BytesObject

2022-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is a legacy of Python 2. Attributes and variable names are Unicode strings in Python 3, so the main reason of this optimization is no longer relevant. But some programs can still work with encoded bytes instead of strings. In particular

[issue46866] bytes class extension with slices

2022-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is consistent with all of builtin types. If you want to return a different type, override __getitem__(). -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -&g

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2022-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b57dbe5d1be925b99f16fe5893e339f92fc05888 by Thomas Grainger in branch 'main': bpo-38415: Remove redundant AsyncContextDecorator.__call__ override from _AsyncGeneratorContextManager (GH-30233) https://github.com/python/cpython/commit

[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See the grammar. https://docs.python.org/3/reference/expressions.html#conditional-expressions conditional_expression ::= or_test ["if" or_test "else" expression] expression ::= conditional_expression | lambda_expr `*()`

[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is an invalid syntax. Write foo(*((stri,) if stri else ())). -- nosy: +serhiy.storchaka resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue46820] SyntaxError on `1not in...`

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

[issue42766] urllib.request.HTTPPasswordMgr uses commonprefix instead of commonpath

2022-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry I did not notice this issue. It is now solved in issue46756. In any case thank you for the report and the PR. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: patch review -> resolved status: open -> closed s

[issue46756] Incorrect authorization check in urllib.request

2022-02-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +lukasz.langa, ned.deily, pablogsal priority: high -> release blocker ___ Python tracker <https://bugs.python.org/issu

[issue46756] Incorrect authorization check in urllib.request

2022-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e2e72567a1c94c548868f6ee5329363e6036057a by Serhiy Storchaka in branch 'main': bpo-46756: Fix authorization check in urllib.request (GH-31353) https://github.com/python/cpython/commit/e2e72567a1c94c548868f6ee5329363e6036057a

[issue46756] Incorrect authorization check in urllib.request

2022-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it is the same. I should search before writing a patch. But for some reasons I prefer my solution over the one proposed in issue42766: The code is clearer and more strict, tests use public API instead of a private method

[issue46820] SyntaxError on `1not in...`

2022-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 98c3bea4d1c7335135e60946d0ec8cd5031fb6c0 by Serhiy Storchaka in branch 'main': bpo-46820: Refactor tests for ambiguous end of numerical literal (GH-31494) https://github.com/python/cpython/commit/98c3bea4d1c7335135e60946d0ec8cd5031fb6c0

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also Future.result() and Future.exception() can raise a CancelledError. So a CancelledError raised in a task may not contain a message passed to Task.cancel(). import asyncio import random async def main(): fut = asyncio.Future() fut.cancel

[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For reference, the msg parameter of Task.cancel() was added in issue31033. It seems that the initial use case was for debugging. I do not see how it differs from the following example: r = random.random() if r < 0.5: x = 0 e

[issue46622] Add an async variant of lru_cache for coroutines.

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: async_lru_cache() and async_cached_property() can be written using that decorator. The implementation of async_lru_cache() is complicated because the interface of lru_cache() is complicated. But it is simpler than using _lru_cache_wrapper(). def

[issue46622] Add an async variant of lru_cache for coroutines.

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that it would be simpler to add a decorator which wraps the result of an asynchronous function into an object which can be awaited more than once: def reawaitable(func): @wraps(func) def wrapper(*args, **kwargs): return

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