Serhiy Storchaka added the comment:
New changeset 20a88004bae8ead66a205a125e1fe979376fc3ea by Serhiy Storchaka in
branch 'main':
bpo-12022: Change error type for bad objects in "with" and "async with"
(GH-26809)
https://gi
Serhiy Storchaka added the comment:
New changeset 6cb145d23f5cf69b6d7414877d142747cd3d134c by Serhiy Storchaka in
branch 'main':
bpo-44471: Change error type for bad objects in ExitStack.enter_context()
(GH-26820)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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 1d08d85cbe49c0748a8ee03aec31f89ab8e81496 by Illia Volochii in
branch 'main':
bpo-43232: Remove previously deprecated methods on TransportSocket (GH-24538)
https://github.com/python/cpython/commit/1d08d85cbe49c0748a8ee03aec31f8
Serhiy Storchaka added the comment:
What Python version did you tried?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
New changeset ddd5f36971e2ffe20cc3f4b408425c847d168646 by Illia Volochii in
branch 'main':
bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor
(GH-24540)
https://github.com/python/cpython/commit/ddd5f36971e2ffe20cc3f4b408425c
Serhiy Storchaka added the comment:
Thank you for your contribution Illia.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Serhiy Storchaka :
--
nosy: +vinay.sajip
___
Python tracker
<https://bugs.python.org/issue44543>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
assignee: -> serhiy.storchaka
versions: +Python 3.11 -Python 3.8
___
Python tracker
<https://bugs.python.org/issue43518>
___
_
Serhiy Storchaka added the comment:
In ideal world we would use __int__ for (1), and __trunc__ for (2). But for
some historical reasons __index__ was introduced for (1) and __int__ is only
used in the int constructor, although it falls back to __trunc__.
I am wondering whether one of
Serhiy Storchaka added the comment:
It is not so uncommon to write:
foo_rate = float(os.getenv("FOO_RATE", default_foo_rate))
where default_foo_rate is float.
In any case the default value for the default parameter is not a string.
--
nosy: +serhiy
Change by Serhiy Storchaka :
--
nosy: +methane, rhettinger, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44555>
___
___
Python-bugs-list m
Change by Serhiy Storchaka :
--
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue44550>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Serhiy Storchaka :
--
Removed message: https://bugs.python.org/msg396889
___
Python tracker
<https://bugs.python.org/issue44550>
___
___
Python-bug
Serhiy Storchaka added the comment:
New changeset 1097384ce964dd63686b1aac706cd0fa764c2dc9 by Ken Jin in branch
'main':
bpo-44553 : Implement GC methods for types.Union (GH-26993)
https://github.com/python/cpython/commit/1097384ce964dd63686b1aac706cd0fa764c2dc9
-
Serhiy Storchaka added the comment:
I am still not sure that it is worth to add 50 lines of the C code to optimize
0.7% of calls.
You have found 7 examples of function calls with 3 or 4 constant arguments.
Does it include tests? Could you please show several (or several hundreds)
non
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25564
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27004
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset 556d5ad11fb380868c19beeba53d49f89c27f32d by Daniel Hillier in
branch 'main':
bpo-44129: Add descriptive global variables for general purpose bit flags
(GH-26118)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
Thank you for your contribution Daniel.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: -Python 3.10
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Great!
Common examples are str.replace(), re.Match.groups() and __exit__(None, None,
None). Common anti-patterns include slice(None, None, None) (why not
slice(None)?) and datetime(1970, 1, 1) (it should be a global constant). I
suspect that in most of
Serhiy Storchaka added the comment:
There is the same bug in ga_new(): tp_free is called directly.
And is is correct to call deallocator for not initialized GenericAlias object?
--
nosy: +serhiy.storchaka
___
Python tracker
<ht
New submission from Serhiy Storchaka :
In tee.fromiterable() the non-initialized tee object can be deleted by without
calling _Py_ForgetReference() in debug build.
See also issue44553 and issue44562.
The proposed PR rewrites the code so that it no longer need to delete not
completely
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25579
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27020
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
But is alias->origin initialized to safely call Py_XDECREF(alias->origin)?
--
___
Python tracker
<https://bugs.python.org/i
Serhiy Storchaka added the comment:
AFAIK PyType_GenericAlloc is used indirectly in ga_new(), but not in
Py_GenericAlias().
--
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
What if set the last item as an attribute of the takewhile iterator?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
On other hand, there are classes which define __int__ but not __trunc__: UUID
and IP4Address. So it makes sense to keep separate __int__ and __trunc__.
--
___
Python tracker
<https://bugs.python.org/issue44
Change by Serhiy Storchaka :
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
For convenience, the takewhile iterator can also have additional attributes: a
boolean attribute which indicates that the falsifying element is set, and
dynamic attribute which is equal to orig_iterator or chain([odd_element],
orig_iterator
Serhiy Storchaka added the comment:
It is a duplicate of issue734176.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Make Tkinter.py's nametowidget work with cloned menu widgets
___
Pytho
Change by Serhiy Storchaka :
--
resolution: -> out of date
stage: -> resolved
status: pending -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
It is a duplicate of issue43838.
--
nosy: +serhiy.storchaka
resolution: -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder: -> There is a way to access an underlying mapping in
Mapp
Serhiy Storchaka added the comment:
Example of modifying a builtin type:
>>> class Sneaky:
... def __eq__(self, other):
... other['real'] = 42
...
>>> int.__dict__ == Sneaky()
>>> (1).real
42
But it can also lead to crash (due to ou
New submission from Serhiy Storchaka :
1. Different handling of None:
>>> isinstance(None, int | type(None))
True
>>> issubclass(type(None), int | type(None))
True
>>> isinstance(None, int | None)
True
>>> issubclass(type(None), int | None)
False
2. Diff
Serhiy Storchaka added the comment:
What other Turtle implementations support the teleport command?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44
Change by Serhiy Storchaka :
--
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 1.0 -> 2.0
pull_requests: +25652
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27107
___
Python tracker
<https://bugs.p
Serhiy Storchaka added the comment:
Thank you for your report stardust222. Indeed, there is a leak if an argument
is a sequence or set, but not list or tuple. PR 27107 fixes it.
--
components: +Extension Modules -C API, Tkinter
versions: +Python 3.10, Python 3.11
Serhiy Storchaka added the comment:
I have found this when refactored the code of Objects/unionobject.c. So I have
a patch which fixes this, but I want to make sure what behavior is considered
correct.
--
___
Python tracker
<ht
Serhiy Storchaka added the comment:
3. There is also a crash in isinstance():
>>> class BadMeta(type):
... def __instancecheck__(cls, inst):
... 1/0
...
>>> x = int | BadMeta('A', (), {})
>>> isinstance([], x)
Fatal Python error: _Py_Check
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25665
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27120
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
type: behavior -> crash
___
Python tracker
<https://bugs.python.org/issue44606>
___
___
Python-bugs-list mailing list
Un
Serhiy Storchaka added the comment:
PR 27120 fixes __instancecheck__ and __subclasscheck__. Converting None to
type(None) will be done in other PR.
--
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
New changeset 81989058de381108dfd0a4255b93d4fb34417002 by Serhiy Storchaka in
branch 'main':
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type.
(GH-27120)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset f572cbf1faab33d9afbbe3e95738ed6fbe6e48e6 by Serhiy Storchaka in
branch 'main':
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
https://github.com/python/cpython/commit/f572cbf1faab33d9afbbe3e95738ed
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Serhiy Storchaka :
>>> import typing
>>> int | typing.T
int | ~T
>>> typing.T | int
typing.Union[~T, int]
>>> T2 = TypeVar('T2')
>>> int | T2
typing.Union[int, ~T2]
>>> T2 | int
typing.Union[~T2, int]
There i
New submission from Serhiy Storchaka :
>>> import typing
>>> (int | typing.T)[1]
NotImplemented
It is related to issue44632.
--
components: Interpreter Core
messages: 397468
nosy: gvanrossum, kj, serhiy.storchaka
priority: normal
severity: normal
status: open
title:
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Serhiy Storchaka :
There is a difference between typing.Union and the builtin union type in
representing None in __args__:
>>> import typing
>>> typing.Union[int, None].__args__
(, )
>>> typing.Union[int, type(None)].__args__
(, )
>&g
Change by Serhiy Storchaka :
--
nosy: +gvanrossum, kj
___
Python tracker
<https://bugs.python.org/issue44635>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25679
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27136
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
typing.Union always collapsed to a simple type if it contains a single type.
>>> import typing
>>> typing.Union[int, typing.T][int]
But the builtin union type can contain a single type:
>>> (int | typing.T)[int]
int
&g
Change by Serhiy Storchaka :
--
dependencies: +Union with TypeVar does not work as intended
___
Python tracker
<https://bugs.python.org/issue44636>
___
___
Pytho
Change by Serhiy Storchaka :
--
dependencies: +Union with TypeVar does not work as intended
___
Python tracker
<https://bugs.python.org/issue44633>
___
___
Pytho
Serhiy Storchaka added the comment:
Good question. It works correctly in list[T]. There is a tiny difference
between implementations of the check in genericaliasobject.c and unionobject.c.
--
___
Python tracker
<https://bugs.python.org/issue44
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25681
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27139
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset b81cac05606c84958b52ada09f690463a3c7e949 by Serhiy Storchaka in
branch 'main':
bpo-44635: Convert None to NoneType in the union type constructor (GH-27136)
https://github.com/python/cpython/commit/b81cac05606c84958b52ada09f6904
Change by Serhiy Storchaka :
--
pull_requests: +25684
pull_request: https://github.com/python/cpython/pull/27142
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
New changeset a158b20019b50e3ece6e4743ec4e6ae8d818b690 by Serhiy Storchaka in
branch 'main':
bpo-44632: Fix support of TypeVar in the union type (GH-27139)
https://github.com/python/cpython/commit/a158b20019b50e3ece6e4743ec4e6a
Serhiy Storchaka added the comment:
New changeset 6dec5255829a31826990ea40ca106cc496570df2 by Serhiy Storchaka in
branch '3.10':
[3.10] bpo-44635: Convert None to NoneType in the union type constructor
(GH-27136). (GH-27142)
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 cc1a47c849a206441c9b370b6ca954862a523082 by Miss Islington (bot)
in branch '3.10':
bpo-44632: Fix support of TypeVar in the union type (GH-27139) (GH-27143)
https://github.com/python/cpython/commit/cc1a47c849a206441c9b370b6ca954
Change by Serhiy Storchaka :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Serhiy Storchaka added the comment:
Simple example (without indexing):
>>> import typing
>>> typing.Union[int, int]
>>> int | int
int
--
___
Python tracker
<http
New submission from Serhiy Storchaka :
The union type accepts any function from the typing module:
>>> import typing
>>> int | typing.cast
int | typing.cast
>>> int | typing.get_type_hints
int | typing.get_type_hints
It is a consequence of too lenient check for
Serhiy Storchaka added the comment:
It is a difference with typing.Union which can cause confusion. If the union
type is like a tuple and we leave a 1-type union, why do we bother with
deduplication? Why int | str | int is collapsed into int | str?
Also it complicates the comparison
New submission from Serhiy Storchaka :
There is a rule: equal hashable objects should have the same hash. The unity
type violates it.
>>> x = int | str
>>> y = str | int
>>> x == y
True
>>> hash(x) == hash(y)
False
And hashes of equal unity typ
Serhiy Storchaka added the comment:
It is only reminder that our test for NewType is arbitrary. And it is not
compatible with PR 9951. Possible solutions are:
1. Make NewType a class and add more strict test. Pro -- we can make arbitrary
repr, contra -- it has small negative effect on
Change by Serhiy Storchaka :
--
nosy: +mark.dickinson
___
Python tracker
<https://bugs.python.org/issue44651>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25715
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27178
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25716
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27179
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset d9f923280f204204f8703756aef4f655b579b4b8 by Serhiy Storchaka in
branch 'main':
bpo-44636: Collapse union of equal types (GH-27178)
https://github.com/python/cpython/commit/d9f923280f204204f8703756aef4f6
Change by Serhiy Storchaka :
--
pull_requests: +25718
pull_request: https://github.com/python/cpython/pull/27181
___
Python tracker
<https://bugs.python.org/issue44
New submission from Serhiy Storchaka :
There are two issues related to the order of __args__ in typing.Union and the
union type.
1. Indexing typing.Union preserves the order of arguments, but it is not always
true when use the | operator.
>>> A = typing.NewType('A', st
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25722
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27185
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
New changeset c3007ab3c6cb384203bac8aa64d89c4b42f671a1 by Serhiy Storchaka in
branch '3.10':
[3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181)
https://github.com/python/cpython/commit/c3007ab3c6cb384203bac8aa64d89c
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 0cd2d51aadcd2a0c0739a5df0a6235d64f35619e by Serhiy Storchaka in
branch 'main':
bpo-44652: Preserve natural order of args in the union type. (GH-27185)
https://github.com/python/cpython/commit/0cd2d51aadcd2a0c0739a5df0a6235
Change by Serhiy Storchaka :
--
pull_requests: +25726
pull_request: https://github.com/python/cpython/pull/27190
___
Python tracker
<https://bugs.python.org/issue44
New submission from Serhiy Storchaka :
>>> import typing
>>> T = typing.TypeVar('T')
>>> (int | T)[typing.Union[str, list]]
NotImplemented
See also issue44633. But in this case the expected result is int | str | list
or typing.Union[init, str, list].
--
Serhiy Storchaka added the comment:
Expected raising a TypeError.
--
___
Python tracker
<https://bugs.python.org/issue44633>
___
___
Python-bugs-list mailin
New submission from Serhiy Storchaka :
I started reviewing and rewriting Objects/unionobject.c several weeks ago. Some
discovered bugs were reported and fixed in separate issues: issue44606,
issue44632, issue44635, issue44636, issue44646, issue44652. Before fixing the
remaining bugs
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25731
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27196
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
> Yeah I noticed it re-lookups __module__ unnecessarily multiple times for the
> same type.
Actually I thought about this change, but did not implement it. Because it does
not look performance critical, and future versions will likely do different
Change by Serhiy Storchaka :
--
title: Remove Ivan from list of,typing experts -> Remove Ivan from list of
typing experts
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
nosy_count: 8.0 -> 9.0
pull_requests: +25743
pull_request: https://github.com/python/cpython/pull/27207
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
pull_requests: -25745
___
Python tracker
<https://bugs.python.org/issue44653>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
pull_requests: -25744
___
Python tracker
<https://bugs.python.org/issue44633>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
pull_requests: +25759
pull_request: https://github.com/python/cpython/pull/27218
___
Python tracker
<https://bugs.python.org/issue44
Change by Serhiy Storchaka :
--
pull_requests: -25756
___
Python tracker
<https://bugs.python.org/issue44633>
___
___
Python-bugs-list mailing list
Unsubscribe:
Serhiy Storchaka added the comment:
New changeset 2d055ce13250a4074f66a945381a149a3cf8c46f by Serhiy Storchaka in
branch '3.10':
[3.10] bpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980)
(GH-27207)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 0fd27375cabd12e68a2f12cfeca11a2d5043429e by Serhiy Storchaka in
branch 'main':
bpo-44654: Refactor and clean up the union type implementation (GH-27196)
https://github.com/python/cpython/commit/0fd27375cabd12e68a2f12cfeca11a
Serhiy Storchaka added the comment:
New changeset 03aad3049d1591c76a219dfe089e5367f88f167e by Miss Islington (bot)
in branch '3.10':
[3.10] bpo-44654: Refactor and clean up the union type implementation
(GH-27196) (GH-27219)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
pull_requests: +25764
pull_request: https://github.com/python/cpython/pull/27223
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
New changeset 3ea5332a4365bdd771286b3e9692495116e9ceef by Serhiy Storchaka in
branch 'main':
bpo-44633: Fix parameter substitution of the union type with wrong types.
(GH-27218)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
Is there any example where it causes troubles?
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
New changeset 85b58292cf94de74d028053ac33a65f269f305cb by Miss Islington (bot)
in branch '3.10':
bpo-44633: Fix parameter substitution of the union type with wrong types.
(GH-27218) (GH-27224)
https://github.com/python/cpyt
Serhiy Storchaka added the comment:
New changeset 8f50f44592190b5a8cb115f0d58d577036e68308 by Serhiy Storchaka in
branch 'main':
bpo-44654: Do not export the union type related symbols (GH-27223)
https://github.com/python/cpython/commit/8f50f44592190b5a8cb115f0d58d57
1301 - 1400 of 25874 matches
Mail list logo