Serhiy Storchaka added the comment:
New changeset c8b62bbe46e20d4b6dd556f2fa85960d1269aa45 by Gregory Beauregard in
branch 'main':
bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203)
https://github.com/python/cpython/commit/c8b62bbe46e20d4b6dd556f2fa8596
Serhiy Storchaka added the comment:
Should it? Annotated wraps types, and P.args/P.kwargs are not types.
If make Annotated accepting P.args/P.kwargs (and possible other non-types, e.g.
P), it is a new feature which should be publicly discussed first and
documented. I do not thing it
Serhiy Storchaka added the comment:
getdefaultlocale() falls back to LANG and LANGUAGE. It allows also to specify a
list of looked up environment variables. How could this use case be covered
with getlocale()?
--
nosy: +serhiy.storchaka
Serhiy Storchaka added the comment:
New changeset cbdcae5ab90710e8d82c213f3798af1154670ff9 by Gregory Beauregard in
branch '3.10':
[3.10] bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203)
(GH-31210)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
I do not think it is a backwards incompatible change, but concur with the rest
said by Stefan.
--
___
Python tracker
<https://bugs.python.org/issue45
Serhiy Storchaka added the comment:
Would not testing len(self.difference(other)) == 0 be more efficient? Making a
copy of a set and removing elements one by one may be faster than add elements
one by one, because we only need to allocate a single chunk of memory for a set.
It depends on
Serhiy Storchaka added the comment:
Something like:
_unset = ['unset']
class CachedAwaitable:
def __init__(self, awaitable):
self.awaitable = awaitable
self.result = _unset
def __await__(self):
if self.result is _unset:
self.result =
Serhiy Storchaka added the comment:
Did you try to print a traceback of the exception?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue46
Serhiy Storchaka added the comment:
See also issue18032.
--
___
Python tracker
<https://bugs.python.org/issue46705>
___
___
Python-bugs-list mailing list
Unsub
New submission from Serhiy Storchaka :
If the argument of set.issuperset() is not a set, it is first converted to a
set. It is equivalent to the following code:
if not isinstance(other, (set, frozenset)):
other = set(other)
# The following is equivalent to:
# return
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +29440
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31280
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
The new code is similar to the code of set.isdisjoint(), so we can share the
code if generalize it.
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Serhiy Storchaka :
--
dependencies: +Use-after-free by mutating set during set operations
___
Python tracker
<https://bugs.python.org/issue46
Serhiy Storchaka added the comment:
New changeset e0bc8ee945af96f9395659bbe3cc30b082e7a361 by Alex Waygood in
branch 'main':
bpo-46483: [doc] pathlib classes no longer support parameterized generics
(GH-31281)
https://github.com/python/cpython/commit/e0bc8ee945af96f9395659bbe3cc30
Change by Serhiy Storchaka :
--
nosy: +pitrou
___
Python tracker
<https://bugs.python.org/issue46726>
___
___
Python-bugs-list mailing list
Unsubscribe:
Serhiy Storchaka added the comment:
New changeset 168fd6453b5de15236116f9261d64601d92571ac by Jacob Walls in branch
'main':
bpo-45948: Remove constructor discrepancy in C version of ElementTree.XMLParser
(GH-31152)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset cc6d8f88289917d67237a10f7a0e2439fde7a573 by Jacob Walls in branch
'3.9':
[3.9] bpo-45948: Remove constructor discrepancy in C version of
ElementTree.XMLParser (GH-31152) (GH-31299)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
New changeset c31b8a97a8a7e8255231c9e12ed581c6240c0d6c by Dennis Sweeney in
branch '3.9':
bpo-46615: Don't crash when set operations mutate the sets (GH-31120) (GH-31312)
https://github.com/python/cpython/commit/c31b8a97a8a7e8255231c9e12
Serhiy Storchaka added the comment:
Thanks Dennis for your report and PRs.
Do you mind to analyze also uses of _PySet_NextEntry(), PyDict_Next() and
_PyDict_Next()? Many of them look safe, but _pickle.c seems vulnerable.
--
___
Python tracker
Serhiy Storchaka added the comment:
It is by design. Functions and types are pickled by name. The copy module uses
the pickling protocol and only use different methods for performance or for
non-pickleable objects. Changing this will break existing code.
--
nosy: +serhiy.storchaka
Change by Serhiy Storchaka :
--
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 2.0 -> 3.0
pull_requests: +29477
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31316
___
Python tracker
<https://bugs.p
Serhiy Storchaka added the comment:
See also issue46721. set.issuperset() can get similar optimization.
And set.issubset() will benefit from this optimization if use
set.intersection() in issue46705.
--
keywords: -patch
stage: patch review
Serhiy Storchaka added the comment:
It will be even more efficient after applying a set.intersection() optimization
in issue43464.
--
___
Python tracker
<https://bugs.python.org/issue46
Serhiy Storchaka added the comment:
Is it compatible with C++?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue46748>
___
___
Pytho
Serhiy Storchaka added the comment:
Note that there is a similar issue with cached generators.
>>> from functools import *
>>> @lru_cache()
... def g():
... yield 1
...
>>> list(g())
[1]
>>> list(g())
[]
I am not sure that it is safe to detect
New submission from Serhiy Storchaka :
There is an error in determining a sub-URI in the urllib.request module. Due to
it, if the user is authorized for example.org/foo, it gets also access to
example.org/foobar.
--
components: Library (Lib)
messages: 413280
nosy: orsenthil
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +29502
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31353
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
title: Incorrect -> Incorrect authorization check in urllib.request
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
For now, there are three uses of commonprefix() in the stdlib:
1. In urllib.request it causes a security issue (see issue46756). commonpath()
or just str.startswith() should be used instead.
2. In lib2to3.main. The code contains a workaround around
Serhiy Storchaka added the comment:
You can create a module on PyPI. If it becomes popular we could consider
including in the stdlib.
--
nosy: +serhiy.storchaka
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Pytho
New submission from Serhiy Storchaka :
There are some issues with formatting added or removed parameters in the
asyncio module.
1. "deprecated-removed" directives were used for already removed directives. It
should be used for deprecated features with known term of removal. F
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +29533
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31388
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
6. The loop parameter of Task() was documented as both removed and required (if
there is no current event loop) in 3.10.
--
___
Python tracker
<https://bugs.python.org/issue46
Serhiy Storchaka added the comment:
It would return 1/7 for "0.1" and 1/4 for "0.2". Is it what you expected?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bug
Serhiy Storchaka added the comment:
New changeset 2923d87ca258b9d421e8147b12f0d98295ee3f8e by Serhiy Storchaka in
branch 'main':
bpo-46777: Fix incorrect use of directives in asyncio documentation (GH-31388)
https://github.com/python/cpython/commit/2923d87ca258b9d421e8147b12f0d9
New submission from Serhiy Storchaka :
Before 3.10 many asyncio classes did have an optional parameter "loop". It was
deprecated in 3.8. To simplify the code, such classes inherited a constructor
from _LoopBoundMixin which set the _loop attribute and (since 3.8) emitted a
warning i
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +29566
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31431
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +29567
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31432
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
It is because we did not have a plan for removing deprecates features.
Deprecation in documentation only helps third-party code. Instead of adding a
complex code which switches between using old and new names depending on Python
version, the third-party
Change by Serhiy Storchaka :
--
Removed message: https://bugs.python.org/msg413574
___
Python tracker
<https://bugs.python.org/issue46804>
___
___
Python-bug
Change by Serhiy Storchaka :
--
Removed message: https://bugs.python.org/msg413575
___
Python tracker
<https://bugs.python.org/issue46804>
___
___
Python-bug
Change by Serhiy Storchaka :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Wrong type when missname dataclass attribute with existing
variable name
___
Python tracker
<https://bugs.python
Serhiy Storchaka added the comment:
New changeset b77158b4da449ec5b8f682816a79d004fd65ed07 by Lital Natan in branch
'main':
bpo-39327: Close file descriptors as soon as possible in shutil.rmtree
(GH-31384)
https://github.com/python/cpython/commit/b77158b4da449ec5b8f682816a79d0
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
> In the long run, it would be better to migrate the implementations in the
> other direction. Rewrite genericpath, ntpath, posixpath, and parts of shutil
> to use PurePath and Path objects.
pathlib does not allow to distinguish "pa
Serhiy Storchaka added the comment:
Good catch. Thank you for your report Patrick.
--
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +29608
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31479
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset 090e5c4b946b28f50fce445916c5d3ec45c8f45f by Serhiy Storchaka in
branch 'main':
bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in"
(GH-31479)
https://github.com/p
Change by Serhiy Storchaka :
--
pull_requests: +29624
pull_request: https://github.com/python/cpython/pull/31494
___
Python tracker
<https://bugs.python.org/issue46
Serhiy Storchaka added the comment:
New changeset f20ac2ed076df63a77f65ff2660148af9f1a9b3c by Miss Islington (bot)
in branch '3.10':
bpo-46820: Fix a SyntaxError in a numeric literal followed by "not in"
(GH-31479) (GH-31493)
https://github.com/p
Serhiy Storchaka added the comment:
What exactly was happened? What rule was changed? Can it cause other changes
which allow ambiguous code or change semantic?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue46
Serhiy Storchaka added the comment:
I concur with Zachary.
Note that suppress without arguments corresponds to "except" and isinstance()
with empty tuple.
--
nosy: +serhiy.storchaka
resolution: -> not a bug
stage: -> resolved
status
Serhiy Storchaka added the comment:
The re module does not support features corresponding to
std::regex_constants::__polynomial in C++. Rewrite your regular expression or
try to use alternative regex implementations (for example wrappers around the
re2 library or C++ regex library
Serhiy Storchaka added the comment:
No, I say that
with suppress():
...
is equivalent to
try:
...
except ():
pass
or
try:
...
except BaseException as err:
if not isinstance(err, ()):
raise
If you want to suppress all
Serhiy Storchaka added the comment:
What about `CancelledError(*msg_list)` or
`CancelledError(*reversed(msg_list))`? It is backward compatible and all
messages are uniformely represented.
--
nosy: +serhiy.storchaka
___
Python tracker
<ht
Serhiy Storchaka added the comment:
Seems a CancelledError message can be lost also in Condition.wait().
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45
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
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
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
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
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/98c3bea4d1c7335135e60946d0ec8c
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
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/e2e72567a1c94c548868f6ee532936
Change by Serhiy Storchaka :
--
nosy: +lukasz.langa, ned.deily, pablogsal
priority: high -> release blocker
___
Python tracker
<https://bugs.python.org/issu
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
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11
___
Python tracker
<https://bugs.python.or
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
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
`*()`
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/cpyt
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
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
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/is
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44863>
___
___
Python-bugs-list mailing list
Unsub
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
Change by Serhiy Storchaka :
--
nosy: +gvanrossum, kj
___
Python tracker
<https://bugs.python.org/issue46927>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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.o
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/p
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/496c428de3318c9c5770937491b71d
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
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/cpyt
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,
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
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
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/36dd7396fcd26d8bf9919d536d05d7
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
Serhiy Storchaka added the comment:
The recommended way is to use importlib.import_module().
--
___
Python tracker
<https://bugs.python.org/issue46953>
___
___
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
Change by Serhiy Storchaka :
--
pull_requests: +29887
pull_request: https://github.com/python/cpython/pull/31781
___
Python tracker
<https://bugs.python.org/issue43
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
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/02fbaf4887deaf0207a5805d3736e0
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
201 - 300 of 25874 matches
Mail list logo