Ken Jin added the comment:
> Now a subclass of an Annotated alias is a generic type. Should it be?
I'm unsure if Annotated should be subclassable in the first place, but if I
understand PEP 593 correctly,
class X(Annotated[int, (1, 10)]), should be equivalent to class X(int) ri
Change by Ken Jin :
--
pull_requests: +26327
pull_request: https://github.com/python/cpython/pull/27872
___
Python tracker
<https://bugs.python.org/issue38
New submission from Ken Jin :
This is a feature request by a user at
https://github.com/python/typing/issues/822.
A copy of their request:
Currently issubclass cannot be used for runtime_checkable protocols with data
members, because those attributes could be set in __init__. I propose to
Change by Ken Jin :
--
keywords: +patch
pull_requests: +26338
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/27883
___
Python tracker
<https://bugs.python.org/issu
Ken Jin added the comment:
Thanks for the bug report Anup. I'm mildly confused by what you meant, so
please help me here:
I interpreted your request as wanting any type that implements `method` and
`__iter__` to be considered a subtype of `IterableWithMethod`. But this already
wor
Ken Jin added the comment:
New changeset edae42f99f8153b92ccf365dbd1c2fa954f913b4 by DonnaDia in branch
'main':
bpo-44925: [docs] Fix confusing deprecation notice for typing.IO (GH-28004)
https://github.com/python/cpython/commit/edae42f99f8153b92ccf365dbd1c2f
Change by Ken Jin :
--
pull_requests: +26538
pull_request: https://github.com/python/cpython/pull/28095
___
Python tracker
<https://bugs.python.org/issue44
Ken Jin added the comment:
@Victor, with your patch applied, for test_typing (locally, Windows x64):
$ ./python -m test test_typing -R 3:20
Different result on every run (race condition maybe?)
$ ./python -m test test_typing -R 1:20
Same result as yours on every run.
--
nosy: +kj
Change by Ken Jin :
--
nosy: +kj, lukasz.langa, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45081>
___
___
Python-bugs-list mailin
Ken Jin added the comment:
I suspect this may be intentional. See related issues
https://bugs.python.org/issue35190 and https://bugs.python.org/issue23864.
Copying verbatim from what Ivan said in the first issue:
"
The separation may look arbitrary, but the idea is quite simple. Only
Change by Ken Jin :
--
nosy: +kj
___
Python tracker
<https://bugs.python.org/issue45094>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ken Jin added the comment:
Guido, OP has kindly written a mini PEP for this. Do you think just updating
PEP 589 is sufficient, or do we need a full PEP?
(PS. Changed version to 3.11 since we've missed the train for 3.10
enhancements).
--
versions: -Python
Change by Ken Jin :
--
nosy: +gvanrossum, kj
___
Python tracker
<https://bugs.python.org/issue45100>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Ken Jin :
I plan to do two improvements over the initial implementation:
1. General comments cleanup and optimize LOAD_METHOD_CLASS.
2. Implement LOAD_METHOD_SUPER, for super().meth() calls.
See Issue44889 for the precursor.
--
components: Interpreter Core
Change by Ken Jin :
--
keywords: +patch
pull_requests: +26604
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28177
___
Python tracker
<https://bugs.python.org/issu
Change by Ken Jin :
--
priority: normal -> critical
title: Regression in 3.9.7 with typing.Protocol -> Calling super().__init__ in
subclasses of typing.Protocol raises RecursionError
versions: +Python 3.10, Python 3.11
___
Python tracker
Ken Jin added the comment:
New changeset c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f by Yurii Karabas in
branch 'main':
bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass'
__init__ (GH-28206)
https://github.com/python
Change by Ken Jin :
--
pull_requests: +26653
pull_request: https://github.com/python/cpython/pull/28233
___
Python tracker
<https://bugs.python.org/issue45
Change by Ken Jin :
--
nosy: +kj
nosy_count: 2.0 -> 3.0
pull_requests: +26771
pull_request: https://github.com/python/cpython/pull/28357
___
Python tracker
<https://bugs.python.org/issu
Change by Ken Jin :
--
nosy: +kj
___
Python tracker
<https://bugs.python.org/issue45116>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ken Jin added the comment:
Please see https://bugs.python.org/issue45203. A fix is available at
https://github.com/python/cpython/pull/28357 or
https://github.com/python/cpython/pull/28386. But we're waiting for Windows CI
to pass.
--
nosy
Ken Jin added the comment:
New changeset 4857e53890408fd5a8ee0e83c0250dd5355b3de3 by Ken Jin in branch
'main':
bpo-45203: fix compiler warnings (GH-28357)
https://github.com/python/cpython/commit/4857e53890408fd5a8ee0e83c0250d
Ken Jin added the comment:
Fixed in
https://github.com/python/cpython/commit/4857e53890408fd5a8ee0e83c0250dd5355b3de3.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Ken Jin added the comment:
@neonene
Thanks for the truly excellent investigation!
@Raymond and @Steve,
If I understood OP (neonene) properly, changing Py_DECREF to a macro won't get
back the entire 7% lost performance in pyperformance. neonene's investigations
suggest that the e
Ken Jin added the comment:
New changeset 70bed6f9936c811472b376edd93c37bcf8f06f35 by Ken Jin in branch
'main':
bpo-45107: Make LOAD_METHOD_CLASS safer and faster, clean up comments (GH-28177)
https://github.com/python/cpython/commit/70bed6f9936c811472b376edd93c37
Ken Jin added the comment:
> How severe is the regression?
OP provided pyperformance of current 3.10 vs their patched version at
https://bugs.python.org/file50280/310rc2_benchmarks.txt. The patch is at
https://bugs.python.org/msg401
Ken Jin added the comment:
@Pablo,
> If is correct ...
For some verification, I benched pyperformance on Win10 AMD64, with the Python
3.10a7 and 3.10rc2 x64 binaries downloaded directly from python.org website
release pages. The results corroborate with neonene's (please see the
Ken Jin added the comment:
Like what Ma Lin and neonene have mentioned above, PR28475 recovered half of
the lost performance. It's unfortunately still 4% slower than 3.10a7.
>pyperf compare_to 310a7.json 310rc2.json 310rc2patched.json
Geometric mean (versus 3.10a7)
==
Change by Ken Jin :
--
nosy: +kj
___
Python tracker
<https://bugs.python.org/issue45256>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ken Jin added the comment:
Erlend, I suspect that 050d1035957379d70e8601e6f5636637716a264b may have
introduced a perf regression in pyperformance's sqlite_synth benchmark:
https://speed.python.org/timeline/?exe=12&base=&ben=sqlite_synth&env=1&revs=50&equid=off&qu
Ken Jin added the comment:
This makes ``get_type_hints`` quite opinionated and backwards incompatible. The
first line the docs says "This is often the same as obj.__annotations__".
I also agree with Guido. FYI, we've tried to *reduce* usage of `_type_check` in
new feature
Ken Jin added the comment:
> 1. By adding the same `_type_check` logic we can reduce the inconsistency
> between two versions. It would be easier for users to migrate from one
> version to another.
That's definitely a plus. But please consider this hypothetical scenario:
-
New submission from Ken Jin :
LOAD_METHOD + CALL_METHOD currently doesn't work for Python @classmethod and C
classmethod (METH_CLASS). They still create bound classmethods which are fairly
expensive.
I propose supporting classmethods. I have an implementation for C classmethods.
It p
Change by Ken Jin :
--
keywords: +patch
pull_requests: +26961
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28572
___
Python tracker
<https://bugs.python.org/issu
Change by Ken Jin :
--
title: _PyObject_GetMethod/LOAD_METHOD for C classmethods -> Speed up
classmethod calls via LOAD_METHOD
___
Python tracker
<https://bugs.python.org/issu
Ken Jin added the comment:
> If someone wants this issue to be solved in 3.10.0 it must be resolved ASAP.
neonene suggested that the tracing tests for pattern matching (added in
3.10b4/rc1) caused PGO to wrongly optimize the more uncommon tracing paths in
ceval. I will verify their one-l
Ken Jin added the comment:
Sadly, I can't reproduce the speedups OP reported from disabling
test_patma.TestTracing. It's not any faster than what we have with PR28475.
(See attached pyperformance).
I'm looking forward to their other fix :). Even if it comes in 3.10.1 that&
Ken Jin added the comment:
@Pablo
> I disagree. This is a regression/bug and we don't advertise "known bugs" in
> the what's new, the same for any other bugfix that has been delayed until
> 3.10.1
Alright, in hindsight 3.10 What's New was a bad suggestion
New submission from Ken Jin :
Somewhere between May02-May11, dulwich_log benchmark on pyperformance had a
major performance regression on the 3.10 branch.
https://speed.python.org/timeline/?exe=12&base=&ben=dulwich_log&env=1&revs=200&equid=off&quarts=on&extr=o
Ken Jin added the comment:
Ooh thanks Irit, I hadn't considered that. I thought that versions were fixed,
but it seems that we *do* change the 3rd party package versions once in a while.
In that time period, we bumped dulwich from 0.20.20 to 0.20.21
https://github.com/python/pyperfor
Change by Ken Jin :
--
nosy: +gvanrossum, kj, rhettinger, stutzbach
___
Python tracker
<https://bugs.python.org/issue45352>
___
___
Python-bugs-list mailin
Ken Jin added the comment:
> I think those should go with the individual types as well
The list[] and dict[] stdtypes are in a different document from
collections.abc.*. While this helps logical separation, I feel like it'd be
tougher searching for type information compared to our
Ken Jin added the comment:
Thanks Martmists for the bug report, I'll try to address some of your concerns:
> The reason for this seems to be the lack of definition in `opcode.py` aside
> from being mentioned in _specialized_instructions.
If I understood Mark's inten
Ken Jin added the comment:
> Will this change be reflected in co_code?
No. As per PEP 659:
"Once any instruction in a code object has executed a few times, that code
object will be "quickened" by allocating a new array for the bytecode that can
be modified at r
Ken Jin added the comment:
> (Windows doesn't want to install greenlet for pyperformance)
I had the *exact* same issues, I eventually found a workaround for it after
many hours spent guessing.
Initially, setuptools complained that I needed MSVC++ 14.0 or later (even after
I had th
Ken Jin added the comment:
Closing this issue as the behavior in dis module is as intended. For any
potential issues to 3rd party packages discovered in the future, consider
opening an issue in that package's issue tracker, or submitting a brand new
issue to bugs.pytho
Ken Jin added the comment:
> I think we should switch back to debug builds in CI in order to catch failed
> assertions before they get merged.
I'm not Victor, but +1. I've been bitten by release builds not catching things,
see issue44348 for example where I advocated for s
Ken Jin added the comment:
I don't understand your example, T | None doesn't return a types.Union object,
it returns typing.Union/typing.Optional. (I'm assuming this T is the TypeVar in
typing). Which *is* subscriptable.
>>> (T | None)[int].__origin__
typing.Union
Ken Jin added the comment:
No worries!
> So I'll have to add some `if` in my code.
Yeah, we had to do that in the typing module too. Hope you manage to fix your
library without much trouble.
--
___
Python tracker
<https://bugs
Ken Jin added the comment:
I'm closing this as there doesn't seem to be anything left to do. Please do
reopen this issue if you feel that isn't the case.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
__
Ken Jin added the comment:
@Guido,
I hope I didn't misunderstand you, but to clarify, what OP is asking is an
alternative way to construct types.UnionType objects and write:
types.UnionType[int, str]
like how we used to write before 3.10:
typing.Union[int, str]
I don't know w
Change by Ken Jin :
--
nosy: +barry, eli.bendersky, ethan.furman
versions: +Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue45
Ken Jin added the comment:
@Alick yes. To be specific, 3.9.1 and above. 3.9.0 still has the old
behavior.
--
___
Python tracker
<https://bugs.python.org/issue42
Ken Jin added the comment:
ForwardRef is for internal use, and writing ForwardRef('fdsa') is discouraged,
as the docs say:
This class should not be instantiated by a user.
However, I don't see any cons from adding union support, so let's do it!
Note that a workar
Ken Jin added the comment:
Thanks @corona10 for the patch.
@bobbeyreese
The new behavior is available in 3.11 and up. 3.10.x won't be supporting the |
operator.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
versions:
Ken Jin added the comment:
Considering both Inada-san and I can't repro this on Linux and Windows
respectively, I'm closing this and blaming code placement or some magic. Thanks
everyone.
--
resolution: -> rejected
stage: -> resolved
status
Ken Jin added the comment:
@ux, could you please provide more information? What platform are you on, and
what compiler version produces this error?
--
nosy: +christian.heimes
___
Python tracker
<https://bugs.python.org/issue45
Ken Jin added the comment:
Strong +1 from me.
Not to mention some instructions don't even need to read the _PyAdaptiveEntry
apart from recording cache hits, so that's one more dependent load and store
too.
Extremely cheap instructions off the top of my head:
- BINARY_SUBSCR
- L
Change by Ken Jin :
--
nosy: +pitrou, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue45311>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ken Jin added the comment:
I concur with Guido to close this.
--
resolution: -> wont fix
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Ken Jin added the comment:
Rejecting this since annotations are expressions that have side effects (so
anti-patterns are discouraged). If you *really* want this, I suspect str:
"str"="asdf" or using `from __future__ import annotations` will work.
--
resolution:
Ken Jin added the comment:
I'll open separate issues for other similar changes.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.pyth
Ken Jin added the comment:
For future reference, the following opcodes specialized via the PEP 659
specializing adaptive interpreter:
- LOAD_GLOBAL Issue44338
- LOAD_ATTR Issue44337
- STORE_ATTR Issue44826 (2% faster pyperformance)
- BINARY_SUBSCR Issue26280 (2% faster pyperformance
Change by Ken Jin :
--
components: Interpreter Core
nosy: Mark.Shannon, kj
priority: normal
severity: normal
status: open
title: More LOAD_ATTR specializations
type: performance
versions: Python 3.11
___
Python tracker
<https://bugs.python.
Change by Ken Jin :
--
keywords: +patch
pull_requests: +27422
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29146
___
Python tracker
<https://bugs.python.org/issu
Ken Jin added the comment:
Turning a class public or not requires a lot more discussion by the argparse
maintainers (I'm definitely not one of them). Have you considered this
workaround for PyCharm?
from argparse import (
_SubParsersAction, # noqa
ArgumentParser,
)
--
Ken Jin added the comment:
Closing this because this is a linter problem (inside PyCharm), not a Python
problem. In the earlier message I provided a solution for PyCharm.
PS, mypy --strict doesn't complain when I import _SubParsersAction, meaning
most type checkers likely won'
Ken Jin added the comment:
> Where can I get their attention?
I've nosied Raymond on this bug, he should be receiving our messages.
--
___
Python tracker
<https://bugs.python.org
Change by Ken Jin :
--
pull_requests: +27535
pull_request: https://github.com/python/cpython/pull/29271
___
Python tracker
<https://bugs.python.org/issue44
Change by Ken Jin :
--
keywords: +patch
pull_requests: +27536
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29272
___
Python tracker
<https://bugs.python.org/issu
New submission from Ken Jin :
Unless I'm mistaken, the current code in Python/specialize.c doesn't check for
valid tp_version_tag, so version tag could overflow and it wouldn't know any
better.
Ideally, we should add more robust tests for when tp_version_tag overflows, but
t
Ken Jin added the comment:
Argh, I merged GH-29302, but messed up the commit title since I'm on mobile.
Sorry.
Currently it says:
[3.10] bo-45655: Add "relevant PEPs" section to typing documentation (GH-29302)
It should be:
[3.10] bpo-45655: Add "relevant PEP
Change by Ken Jin :
--
pull_requests: -27577
___
Python tracker
<https://bugs.python.org/issue45664>
___
___
Python-bugs-list mailing list
Unsubscribe:
Ken Jin added the comment:
New changeset d9575218d7ab3d85b15ce3d4779660b9b724d343 by Alex Waygood in
branch 'main':
bpo-45655: Add ref to union type expressions at top of typing docs (GH-29309)
https://github.com/python/cpython/commit/d9575218d7ab3d85b15ce3d4779660
Ken Jin added the comment:
New changeset aad48062ef8f983fbb95f9dc0c3c3cef9c89df02 by Nikita Sobolev in
branch 'main':
bpo-45666: fixes warning with `swprintf` and `%s` (GH-29307)
https://github.com/python/cpython/commit/aad48062ef8f983fbb95f9dc0c3c3cef9c89df02
--
Ken Jin added the comment:
New changeset 401d25e92f62a9ef320a97542b3e63cb8c34e7e9 by Nikita Sobolev in
branch 'main':
bpo-45666: Use `%S` for MSVC and `%s` elsewhere for `swprintf` in
`_testembed.c` (GH-29341)
https://github.com/python/cpython/commit/401d25e92f62a9ef320a97542b3e63
Ken Jin added the comment:
@Serhiy Thanks for catching my mistake. I'm glad you came across the PR.
And thank you @Nikita for your patience. Closing this issue!
--
resolution: -> fixed
stage: patch review -> resolved
status: ope
Ken Jin added the comment:
New changeset 454cdb99abcda37413b15167cda564091fec2572 by Dmitry Smirnov in
branch 'main':
bpo-45633: Fix newtypes doc typo (GH-29318)
https://github.com/python/cpython/commit/454cdb99abcda37413b15167cda564091fec2572
--
Ken Jin added the comment:
New changeset bbcf06bf95b448810f1b6f4f119c32e871bfb84c by Serhiy Storchaka in
branch '3.9':
[3.9] bpo-45679: Fix caching of multi-value typing.Literal (GH-29334) (GH-29342)
https://github.com/python/cpython/commit/bbcf06bf95b448810f1b6f4f119c32
Ken Jin added the comment:
New changeset 06247061798a1ac402940d6ec04604ffa0be6c7a by Miss Islington (bot)
in branch '3.10':
bpo-45633: Fix newtypes doc typo (GH-29318) (GH-29364)
https://github.com/python/cpython/commit/06247061798a1ac402940d6ec04604
Ken Jin added the comment:
New changeset 3a93c669f50f090a227e964eb26ce8a3d1dc1202 by Miss Islington (bot)
in branch '3.9':
bpo-45633: Fix newtypes doc typo (GH-29318) (GH-29365)
https://github.com/python/cpython/commit/3a93c669f50f090a227e964eb26ce8
Ken Jin added the comment:
New changeset 0dfb8c4afee65f9e185882efd57f7012120da74c by Erlend Egeberg
Aasland in branch 'main':
bpo-24139: Fix test_sqlite3 `test_extended_error_code_on_exception()` on s390x
RHEL buildbots (GH-29382)
https://github.com/python/cpyt
Ken Jin added the comment:
> Dennis, you mean something like this?
> https://github.com/itamaro/cpython/commit/92d46b260cf6ccce1a47003f539294530138e488
Not Dennis, but these changes looks good. As Serhiy mentioned, we can replace
the hot callsites with PyObject_TypeCheck without s
Ken Jin added the comment:
@Dmitry Smirnov,
Thank you for your fix, and welcome to the CPython project!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Ken Jin added the comment:
Closing this issue as the bug has been solved.
@Nikita could you please open a new issue for your tests PR and link to that
instead? It seems like an enhancement over the current test suite for
lru_cache. Thanks!
--
resolution: -> fixed
stage: pa
Ken Jin added the comment:
New changeset e03e50377d6f8f212af60fed4ae405ebeb73237d by Alex Waygood in
branch 'main':
bpo-45680: ``typing`` docs: improve links to docs on
``GenericAlias``/``__class_getitem__`` (GH-29387)
https://github.com/python/cpyt
Change by Ken Jin :
--
nosy: -kj
___
Python tracker
<https://bugs.python.org/issue43656>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Ken Jin added the comment:
@Dávid
No it won't land in 3.9. Union type expressions (PEP 604) were only officially
added in 3.10. We don't backport new features, only bugfixes. Sorry!
--
___
Python tracker
<https://bugs.python.o
Ken Jin added the comment:
I think I saw a similar bug report elsewhere (or maybe I'm misremembering).
Anyways, Eric is right, the correct way is to wrap the entire thing, so
"Foo|int" instead of "Foo"|int.
@Alex you brought up some good suggestions, I'll tr
Change by Ken Jin :
--
nosy: +kj
___
Python tracker
<https://bugs.python.org/issue45947>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Change by Ken Jin :
--
keywords: +patch
pull_requests: +28165
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29940
___
Python tracker
<https://bugs.python.org/issu
Ken Jin added the comment:
The link to what Andrei is referring to:
https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Network.prefixlen
--
___
Python tracker
<https://bugs.python.org/issue36
Ken Jin added the comment:
Not exactly sure if this is a bug, but the reason is that Foo[int] used to be a
class, now it's a plain object. It's a change brought in 3.7 by PEP 560.
3.6:
>>> isinstance(Foo[int], type)
True
>>> Foo[int].__dir__
>> type(Foo[in
Change by Ken Jin :
--
keywords: +patch
pull_requests: +28187
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29962
___
Python tracker
<https://bugs.python.org/issu
Change by Ken Jin :
--
nosy: +kj
nosy_count: 5.0 -> 6.0
pull_requests: +28188
pull_request: https://github.com/python/cpython/pull/29963
___
Python tracker
<https://bugs.python.org/issu
Ken Jin added the comment:
New changeset c7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6 by Ken Jin in branch
'main':
bpo-35821: Fix restructuredtext code formatting in logging.rst (GH-29963)
https://github.com/python/cpython/commit/c7e7a4b969b5728d4b4f3c59bf98e1
Ken Jin added the comment:
New changeset e2cfc89e099b8fad5d8d5bd7f59dadffb6078778 by Bernát Gábor in
branch 'main':
bpo-45391: mark UnionType as a class in documentation (GH-28757)
https://github.com/python/cpython/commit/e2cfc89e099b8fad5d8d5bd7f59dadffb6078778
--
Ken Jin added the comment:
I'm not sure about the original 10:1 difference in 3.10, but in 3.11, the 2:1
difference might be due to the PEP 659 machinery optimizing for int * int, and
float * float cases (see BINARY_OP_MULTIPLY_INT and BINARY_OP_MULTIPLY_FLOAT in
ceval).
Last I r
Ken Jin added the comment:
As a start, I merged the types.UnionType fix because it's straightforward, but
the rest are a little dubious so I'll leave this issue open for now.
--
title: 3.10 objects.inv classifies UnionType as data -> 3.10 objects.inv
classifies many
Ken Jin added the comment:
FWIW, current code for extracting args type and return type from Callable seems
to be something like this (at least from the typing module):
arg_types = __args__[:-1]
return_type = __args__[-1]
Once ParamSpec is added in, library authors would need to check
301 - 400 of 530 matches
Mail list logo