Change by Serhiy Storchaka :
--
pull_requests: +25766
pull_request: https://github.com/python/cpython/pull/27225
___
Python tracker
<https://bugs.python.org/issue44
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 a6670cdf77aab2b1ee7be0b9df060dcac2a2dc48 by Serhiy Storchaka in
branch '3.10':
[3.10] bpo-44654: Do not export the union type related symbols (GH-27223).
(GH-27225)
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 :
--
pull_requests: -25757
___
Python tracker
<https://bugs.python.org/issue44653>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Serhiy Storchaka :
--
pull_requests: +25780
pull_request: https://github.com/python/cpython/pull/27232
___
Python tracker
<https://bugs.python.org/issue44
New submission from Serhiy Storchaka :
1. Checks for types.Union ignore any non-type args. Checks for typing.Union
require fail on first checked non-type (but it can short circuit).
>>> import typing
>>> T = typing.TypeVar('T')
>>> issubclass(int, int |
Change by Serhiy Storchaka :
--
components: +Library (Lib)
type: -> behavior
versions: +Python 3.10, Python 3.11
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
It is easy to fix once we define the correct behavior in corner cases.
--
___
Python tracker
<https://bugs.python.org/issue44
Change by Serhiy Storchaka :
--
pull_requests: +25795
pull_request: https://github.com/python/cpython/pull/27247
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
There is also problem with other typing types:
>>> (int | T)[typing.List]
Traceback (most recent call last):
File "", line 1, in
TypeError: Each union argument must be a type, got typing.List
>>> (int | T)[typing.List[int]]
Serhiy Storchaka added the comment:
It is a duplicate of issue32112.
--
nosy: +serhiy.storchaka
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Should uuid.UUID() accept another UUID() instance?
__
Serhiy Storchaka added the comment:
Because super().__init__(name, bases, nmspc) does not have any effect. Type is
created by the metaclass' __new__ method, and the __init__ method is virtually
no-op.
--
nosy: +serhiy.storchaka
___
Python tr
Serhiy Storchaka added the comment:
AFAIK pointer arithmetic with NULL has undefined behavior. There is similar
case in list_slice().
--
components: +Interpreter Core
nosy: +mark.dickinson, serhiy.storchaka
type: -> compile error
versions: +Python 3.10, Python 3.11, Python
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25835
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27292
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
I suppose it is a very old code written when str was a function, not a type
(thus using type('')) and builtin types were not subclassable (thus not using
isinstance()).
I once analyzed other similar cases in the stdlib. Seems it is time to revi
New submission from Serhiy Storchaka :
There are several occurrences of type(literal) in the code of the stdlib where
literal is a literal of built-in type: '', 1, [], {}, etc. I suppose it is a
remnants of very old code written when str, int, list, dict, etc were functions
and n
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25837
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27294
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
All cases was manually checked several times (with months passes between
checks). Several cases were preserved: when the name of built-in type
conflicted with the name of function parameter (in weakref.py), when the code
was used for testing type() and
Serhiy Storchaka added the comment:
See also issue44712.
--
___
Python tracker
<https://bugs.python.org/issue44711>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
For __or__ we need to copy the content of both mapping to the resulting mapping
in any case. We can implement it as {**self, **other}. We should not use the
copy() method because it is not a part of the Mapping interface.
For __eq__, no copying is needed
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44353>
___
___
Python-bugs-list mailing list
Unsub
Change by Serhiy Storchaka :
--
pull_requests: +25856
pull_request: https://github.com/python/cpython/pull/27311
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
PR 27311 copies tests from PR 9951, adds support of nested NewTypes (with
__qualname__ containing multiple components) an makes them pickleable by name
as functions and classes.
--
___
Python tracker
<ht
Serhiy Storchaka added the comment:
Currently deprecation warnings are emitted in test_typing:
$ ./python -m test test_typing
0:00:00 load avg: 3.38 Run tests sequentially
0:00:00 load avg: 3.38 [1/1] test_typing
/home/serhiy/py/cpython/Lib/test/test_typing.py:4657: DeprecationWarning
Change by Serhiy Storchaka :
--
resolution: -> not a bug
___
Python tracker
<https://bugs.python.org/issue44721>
___
___
Python-bugs-list mailing list
Un
New submission from Serhiy Storchaka :
The proposed PR simplifies implementation of the union type by removing direct
support of typing types. It was not necessary because all these types implement
__or__ and __ror__ methods.
The only visible difference is that int | TypeVar() etc returns
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +25863
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27318
___
Python tracker
<https://bugs.python.org/issu
Change by Serhiy Storchaka :
--
pull_requests: +25864
pull_request: https://github.com/python/cpython/pull/9951
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
It fixes also issue44642.
--
___
Python tracker
<https://bugs.python.org/issue44731>
___
___
Python-bugs-list mailin
Serhiy Storchaka added the comment:
It is not good to use private method in pickle, because we will not be able to
get rid of it for backward compatibility. Why not use functools.reduce()?
--
nosy: +serhiy.storchaka
status: closed -> o
Change by Serhiy Storchaka :
--
pull_requests: +25867
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/27323
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
There are differences between typing.Union and types.Union:
* typing.Union is indexable, types.Union is not.
* types.Union is a class, typing.Union is not.
types.Union corresponds to typing._UnionGenericAlias, not typing.Union. It is
confusing that
Change by Serhiy Storchaka :
--
components: +Interpreter Core, Library (Lib)
versions: +Python 3.10
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
New changeset 435a0334d341e5f8faed594d9f015746bb7845db by Serhiy Storchaka in
branch 'main':
bpo-44676: Serialize the union type using only public API (GH-27323)
https://github.com/python/cpython/commit/435a0334d341e5f8faed594d9f0157
Serhiy Storchaka added the comment:
New changeset 0aea99e44416f37c75e5540072156dbf90ef1659 by Miss Islington (bot)
in branch '3.10':
bpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
versions: +Python 3.11
___
Python tracker
<https://bugs.python.org/issue41203>
___
___
Python-bugs-list mailing list
Unsubscribe:
Serhiy Storchaka added the comment:
Patrick, are you interested in reviving your PR? It mostly LGTM, except several
not addressed comments. I clarified them.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue41
Serhiy Storchaka added the comment:
I cannot reproduce.
>>> try:
... 1/0
... except:
... print('except')
... raise
... finally:
... print('finally')
...
except
finally
Traceback (most recent call last):
File "", line 2, in
ZeroDiv
Change by Serhiy Storchaka :
--
resolution: -> third party
___
Python tracker
<https://bugs.python.org/issue44739>
___
___
Python-bugs-list mailing list
Un
Serhiy Storchaka added the comment:
It would be nice to add a multi-thread supporting version of tee() or add
multi-thread support in tee(), but this is different issue.
--
stage: patch review -> resolved
status: pending -> closed
___
Serhiy Storchaka added the comment:
I think that List[P] should be illegal at first place.
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
I am writing a patch which generalizes and significantly simplifies the code
for type variables and parameter specifications substitution, and opens a way
for more runtime validation. But it is incompatible with these changes
Serhiy Storchaka added the comment:
I concur with Raymond and Eric.
Note that in general case the problem is more complex that you may expect.
First, some characters can match two characters (e.g. 'ß' matches 'SS'), and
therefore indexes of characters are different in dif
New submission from Serhiy Storchaka :
Substitution of ParamSpec in Concatenate produces weird results:
>>> import typing
>>> P = typing.ParamSpec('P')
>>> typing.Concatenate[str, P][int]
typing.Concatenate[str, int]
>>> typing.Con
New submission from Serhiy Storchaka :
>>> import typing
>>> T = typing.TypeVar('T')
>>> P = typing.ParamSpec('P')
>>> C = typing.Callable[P, T]
>>> C[int, str, float]
typing.Callable[[int], str]
int substitutes P as [
New submission from Serhiy Storchaka :
The proposed PR merges tests for typing.Callable (in test_typing.py) and
collection.abc.Callable (in test_genericalias.py). All old tests are now
executed for both implementations.
It has exposed a bug in typing.Callable (see issue44793) and minor bug
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +26021
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27507
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
Adding __parameters__ and __getitem__ in TypeVar and ParamSpec allows to
generalize and simplify the code (especially the C code) and allows to add more
runtime checks. It may open ways for further simplification.
Unfortunately it is not compatible with
Change by Serhiy Storchaka :
--
dependencies: +Merge tests for typing.Callable and collection.abc.Callable
___
Python tracker
<https://bugs.python.org/issue44
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +26025
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27511
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
See issue44796.
--
___
Python tracker
<https://bugs.python.org/issue44098>
___
___
Python-bugs-list mailing list
Unsub
Serhiy Storchaka added the comment:
If Callable is nested, it works as expected:
>>> typing.List[C][int, str, float]
Traceback (most recent call last):
File "", line 1, in
File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner
Serhiy Storchaka added the comment:
New changeset be4cb9089aaf58d5f90da5f9fa66dc3c6763b5a2 by Serhiy Storchaka in
branch 'main':
bpo-44794: Merge tests for typing.Callable and collection.abc.Callable
(GH-27507)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +26030
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27515
___
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
Serhiy Storchaka added the comment:
There is also similar bug in Generic:
>>> from typing import *
>>> T = TypeVar("T")
>>> P = ParamSpec("P")
>>> class X(Generic[T, P]):
... f: Callable[P, int]
... x: T
...
>>>
Change by Serhiy Storchaka :
--
Removed message: https://bugs.python.org/msg398654
___
Python tracker
<https://bugs.python.org/issue44794>
___
___
Python-bug
Serhiy Storchaka added the comment:
There is also similar bug in Generic:
>>> from typing import *
>>> T = TypeVar("T")
>>> P = ParamSpec("P")
>>> class X(Generic[T, P]):
... f: Callable[P, int]
... x: T
...
>>>
Change by Serhiy Storchaka :
--
Removed message: https://bugs.python.org/msg398655
___
Python tracker
<https://bugs.python.org/issue44796>
___
___
Python-bug
Serhiy Storchaka added the comment:
There is also similar bug in Generic:
>>> from typing import *
>>> T = TypeVar("T")
>>> P = ParamSpec("P")
>>> class X(Generic[T, P]):
... f: Callable[P, int]
... x: T
...
>>>
Serhiy Storchaka added the comment:
My understanding is that type expression is valid when substitute TypeVar and
parameters expression is valid when substitute ParamSpec.
--
___
Python tracker
<https://bugs.python.org/issue44
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +26033
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27518
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
I think it was a mistake to use lock in cached_property at first place. In most
cases there is nothing wrong in evaluating the cached value more than once.
lru_cache() does not use a lock for calling the wrapped function, and it works
well. The only lock
New submission from Serhiy Storchaka :
Type expression is coerced to a list of parameter arguments in substitution of
ParamSpec. For example:
>>> from typing import *
>>> T = TypeVar('T')
>>> P = ParamSpec('P')
>>> C = Callable[P, T]
Change by Serhiy Storchaka :
--
components: +Library (Lib)
dependencies: +Arguments ignored in substitution in typing.Callable
type: -> behavior
versions: +Python 3.10, Python 3.11
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
I concur with Irit. The test is failed in any case, so you need to look at the
code to fix it.
For the same reason we do not have assertNotRaises().
--
nosy: +serhiy.storchaka
___
Python tracker
<ht
New submission from Serhiy Storchaka :
If the user generic with ParamSpec parameter substituted with a parametrised
list containing TypeVar, that TypeVar cannot be substituted.
>>> from typing import *
>>> T = TypeVar("T")
>>> P = ParamSpec("P")
Serhiy Storchaka added the comment:
It was reverted because it did not keep the C version in harmony with the pure
Python version. In the pure Python version pop() calls __getitem__ and
__delitem__ which can be overridden in subclasses of OrederedDict. My patch
always called dict
Change by Serhiy Storchaka :
--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5, Python 3.6, Python
3.7
___
Python tracker
<https://bugs.python.org/issue27
Serhiy Storchaka added the comment:
It is complicated. The pure Python implementation of OrderedDict.popitem() and
OrderedDict.pop() are not consistent. The former uses dict.pop() which doesn't
call __getitem__ and __setitem__. The latter calls __getitem__ and __setitem__.
Change by Serhiy Storchaka :
--
pull_requests: +26043
pull_request: https://github.com/python/cpython/pull/27528
___
Python tracker
<https://bugs.python.org/issue27
Serhiy Storchaka added the comment:
I agree that composition is methodologically more correct than inheritance for
implementing a variant of lru_cache(). But if you need lru_cache() why not use
lru_cache() from the stdlib? I think that instead of showing a poor version of
the lru_cache
Serhiy Storchaka added the comment:
TypeDict is a callable, it can be used as
Point2D = TypedDict('Point2D', x=int, y=int, label=str)
It can also be used as a base in class definition, but is is not a class
itself. It does not occur in __bases__ of the created class, and it
Serhiy Storchaka added the comment:
Actually most names defined in typing are no longer classes.
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python, gvanrossum, kj
versions: +Python 3.11
___
Python tracker
<
Change by Serhiy Storchaka :
--
pull_requests: +26045
pull_request: https://github.com/python/cpython/pull/27530
___
Python tracker
<https://bugs.python.org/issue27
Serhiy Storchaka added the comment:
PR 27528 makes the C implementation of OrderedDict.popitem() consistent with
the Python implementation (do not call overridden __getitem__ and __setitem__).
PR 27530 changes also both implementations of OrderedDict.pop(). It simplifies
the C code, but
Serhiy Storchaka added the comment:
Having a side effect at import time is not good. It will interfere with
programs which just import pdb, but not use it.
There are two other options:
1. Import readline at top level, but call set_completer_delims() lazily.
2. Do not import readline at all
Change by Serhiy Storchaka :
--
nosy: +ned.deily
___
Python tracker
<https://bugs.python.org/issue44804>
___
___
Python-bugs-list mailing list
Unsubscribe:
Serhiy Storchaka added the comment:
New changeset f92b9133ef67e77605cbd315b6b6c81036ce110e by Serhiy Storchaka in
branch 'main':
bpo-44793: Fix checking the number of arguments when subscribe a generic type
with ParamSpec parameter. (GH-27515)
https://github.com/python/cpyt
Change by Serhiy Storchaka :
--
nosy: +serhiy.storchaka
nosy_count: 2.0 -> 3.0
pull_requests: +26048
pull_request: https://github.com/python/cpython/pull/27538
___
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 :
--
nosy: +serhiy.storchaka
versions: +Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.org/issue44806>
___
___
Pytho
Change by Serhiy Storchaka :
--
pull_requests: +26054
pull_request: https://github.com/python/cpython/pull/27545
___
Python tracker
<https://bugs.python.org/issue44
Serhiy Storchaka added the comment:
There is other related case:
>>> from typing import *
>>> class P(Protocol): pass
...
>>> class B:
... def __init__(self):
... self.test = 'OK'
...
>>> class D(P, B):
... pass
...
>>
Serhiy Storchaka added the comment:
You cannot expect that running code under debugger does not have any effect.
Otherwise there would not be any meaning in debugger. Running code under
debugger has some side effects, and setting locals __return__ and __exception__
is one of them. If it
Serhiy Storchaka added the comment:
My concern about importing readline at the top of the module is that importing
readline has a side effect. The only module which imports it unconditionally at
the top is rlcompleter. In all other places it is imported lazily.
And importing readline ahead
Change by Serhiy Storchaka :
--
status: open -> pending
___
Python tracker
<https://bugs.python.org/issue44818>
___
___
Python-bugs-list mailing list
Un
Serhiy Storchaka added the comment:
> It should use "(id(instance), instance)" rather than just "instance" as the
> key.
It should use a dict with id(instance) as a key and instance as value. An
instance can be non-hashable.
--
Serhiy Storchaka added the comment:
Thank you Ken Jin. So the problem is the __args__ (x, str) is interpreted
differently depending on x, and after substituting x the interpretation can be
changed. If x was ParamSpec, it was interpreted in one way, but if it becomes
int, it is now
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +26088
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27585
___
Python tracker
<https://bugs.python.org/issu
Serhiy Storchaka added the comment:
The difference between specifying negative and non-negative third argument of
sqlite3_result_text() is that in the latter case the result can contain
embedded NUL characters.
Could you please add a test for string containing embedded NUL?
Letting SQLite
Change by Serhiy Storchaka :
--
title: [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()
-> [sqlite3] Do not truncate results of user functions and aggregates on the
first NUL
type: enhancement -> behavior
versions: +Python 3.10, Pyth
Serhiy Storchaka added the comment:
New changeset 8f010dc920e1f6dc6a357e7cc1460a7a567c05c6 by Erlend Egeberg
Aasland in branch 'main':
bpo-44822: Don't truncate `str`s with embedded NULL chars returned by `sqlite3`
UDF callbacks (GH-27588)
https://github.com/python
Change by Serhiy Storchaka :
--
keywords: +patch
pull_requests: +26107
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27613
___
Python tracker
<https://bugs.python.org/issu
New submission from Serhiy Storchaka :
Currently, any exception raised in user-defined function set the general
SQLITE_ERROR error which then produce sqlite3.OperationalError.
For example, if the user function returns a string or bytes object larger than
INT_MAX you get OperationalError, but
Serhiy Storchaka added the comment:
It was grown from bigmem tests for issue44822.
--
___
Python tracker
<https://bugs.python.org/issue44839>
___
___
Python-bug
Serhiy Storchaka added the comment:
I am confusing. Why do these objects should have __name__ and __qualname__
attributes? What document specifies this? How are these attributes used?
collections.abc.MutableSet and typing.MutableSet are different things. The
former is a class, the latter is
Serhiy Storchaka added the comment:
Thank you Ken Jin.
But it does not explain why objects which currently have __name__/__qualname__
is None should have these attribute. There is no builtin data type that
corresponds to ClassVar, Final, Literal, Concatenate or TypeGuard. And (int |
str
Serhiy Storchaka added the comment:
Good catch! Thank you Raymond for the third example.
I though that it can be easily fixed by calling tp_traverse() for submapping:
static int
mappingproxy_traverse(PyObject *self, visitproc visit, void *arg)
{
mappingproxyobject *pp
1401 - 1500 of 25874 matches
Mail list logo