[issue47255] Many broken :meth: roles in the docs

2022-04-08 Thread Ken Jin


Ken Jin  added the comment:

It's 3.10 only. Presumably our sphinx version changed then and something broke. 
In 3.9 and earlier the links are all fine.

See https://bugs.python.org/issue42182 for a similar issue I raised ages ago.

--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue47255>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
nosy:  -kj

___
Python tracker 
<https://bugs.python.org/issue47234>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:


New changeset d6a7ee69fb3263450ba47bed9104f4a68a08a9bd by Ken Jin in branch 
'3.9':
[3.9] bpo-46769: Fix backticks in typing.rst to appease rstlint (GH-32375)
https://github.com/python/cpython/commit/d6a7ee69fb3263450ba47bed9104f4a68a08a9bd


--

___
Python tracker 
<https://bugs.python.org/issue46769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:


New changeset 80af26d25af5568229d31ecb2a8f1bf9702b7791 by Ken Jin in branch 
'3.10':
[3.10] bpo-46769: Fix backticks in typing.rst to appease rstlint (GH-32374)
https://github.com/python/cpython/commit/80af26d25af5568229d31ecb2a8f1bf9702b7791


--

___
Python tracker 
<https://bugs.python.org/issue46769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:

I forgot to specify, that this is *only* on 3.10, not main.

--

___
Python tracker 
<https://bugs.python.org/issue47104>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:

Andrew, it seems that the post-commit CI has started failing after this commit. 
Specifically it says "test_asyncio failed (env changed)"

>From this page,
https://github.com/python/cpython/commits/3.10?after=3856b4995ec0e632d47b733cdecb5183ac830568+34=3.10

the Ubuntu CI link for that commit:
https://github.com/python/cpython/runs/5667655099?check_suite_focus=true

Failing buildbots on 3.10:
https://buildbot.python.org/all/#/release_status

Sorry that I can't help more. I'm not an asyncio expert so I'm not sure why 
this is triggering.

--
nosy: +kj
resolution: fixed -> 
status: closed -> open

___
Python tracker 
<https://bugs.python.org/issue47104>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +30418
pull_request: https://github.com/python/cpython/pull/32375

___
Python tracker 
<https://bugs.python.org/issue46769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +30417
pull_request: https://github.com/python/cpython/pull/32374

___
Python tracker 
<https://bugs.python.org/issue46769>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47189] What's new in Python 3.11: Faster CPython

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue47189>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47189] What's new in Python 3.11: Faster CPython

2022-04-06 Thread Ken Jin


New submission from Ken Jin :


New changeset 9ffe47df5468a72603f730eae48c2fd4ec615ffa by Ken Jin in branch 
'main':
bpo-47189: What's New in 3.11: Faster CPython (GH-32235)
https://github.com/python/cpython/commit/9ffe47df5468a72603f730eae48c2fd4ec615ffa


--

___
Python tracker 
<https://bugs.python.org/issue47189>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47205] test_sched_getaffinity and setaffinity fail on FreeBSD buildbit

2022-04-03 Thread Ken Jin


Ken Jin  added the comment:

FWIW, seems like the buildbot started failing at either commit 
cb495a1e9f3acfcd8cb94a6b89c79d0909e3383f or 
708812085355c92f32e547d1f1d1f29aefbbc27e. But I have no clue how commits 
changing the Windows build config can lead to test_posix failing.

--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue47205>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47189] What's new in Python 3.11: Faster CPython

2022-04-01 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +30307
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32235

___
Python tracker 
<https://bugs.python.org/issue47189>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47189] What's new in Python 3.11: Faster CPython

2022-04-01 Thread Ken Jin


Change by Ken Jin :


--
assignee: docs@python
components: Documentation
nosy: docs@python, kj
priority: normal
severity: normal
status: open
title: What's new in Python 3.11: Faster CPython
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue47189>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Ken Jin


Ken Jin  added the comment:

@Victor,

I'm not against (A) or any of the PRs you proposed. They look fine to me. My 
concern was with certain static inline functions (there are none here :). The 
_CAST macros have genuinely helped me debug code before.

--

___
Python tracker 
<https://bugs.python.org/issue47164>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Ken Jin


Ken Jin  added the comment:

> tiny inline function obscures the meaning of code

Sadly I have to agree with Mark for that specific case. I've had to debug a 
segfault before only because the inline function implicitly cast its arguments, 
and it was accessing a non-existent member. If it were a macro it would access 
the struct member directly, and the compiler would be able to catch that and 
warn me before runtime.

However, for the case of _PyCFunctionObject_CAST, I'm not against it. The 
assert(PyCFunction_Check) pattern has genuinely helped me catch problems in the 
case of similar macros.

--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue47164>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47127] Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS

2022-03-27 Thread Ken Jin


Ken Jin  added the comment:


New changeset 58448cbd96f77ebc6fca1f8030bedc7744eb66ef by Kumar Aditya in 
branch 'main':
bpo-47127: Specialize calls for fastcall c methods with keywords (GH-32125)
https://github.com/python/cpython/commit/58448cbd96f77ebc6fca1f8030bedc7744eb66ef


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue47127>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47130] mro and super don't feel so pythonic

2022-03-26 Thread Ken Jin


Ken Jin  added the comment:

Hi @mamliteria, this is the bug tracker for CPython. I understand that you have 
suggestions to improve super(), but feature suggestions usually go on the 
python-ideas mailing list [1]. So you might want to post on there instead.

If you're interested, the MRO creation algorithm uses C3 linearization[2] so 
the output is predictable.

Also maybe the 2-argument form of super() will help. It should cover most cases 
that you propose with __as_parent__.

[1] https://mail.python.org/mailman3/lists/python-ideas.python.org/
[2] https://en.wikipedia.org/wiki/C3_linearization

--
nosy: +kj
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue47130>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46939] Specialize calls for Python classes

2022-03-16 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +30028
pull_request: https://github.com/python/cpython/pull/31936

___
Python tracker 
<https://bugs.python.org/issue46939>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46991] Specialize list[slice]

2022-03-14 Thread Ken Jin


Ken Jin  added the comment:

Closed for now. See 
https://github.com/python/cpython/pull/31870#issuecomment-1066884537 for an 
explanation.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46991>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46991] Specialize list[slice]

2022-03-14 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +29969
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31870

___
Python tracker 
<https://bugs.python.org/issue46991>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43224] Add support for PEP 646

2022-03-12 Thread Ken Jin


Ken Jin  added the comment:


New changeset af2277e461aee4eb96affd06b4af25aad31c81ea by Matthew Rahtz in 
branch 'main':
bpo-43224: Implement PEP 646 changes to genericaliasobject.c (GH-31019)
https://github.com/python/cpython/commit/af2277e461aee4eb96affd06b4af25aad31c81ea


--

___
Python tracker 
<https://bugs.python.org/issue43224>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46991] Specialize list[slice]

2022-03-11 Thread Ken Jin


New submission from Ken Jin :

According to 
https://github.com/faster-cpython/ideas/blob/main/stats.md#binary_subscr
it's the second most common failed specialization.

array.array[int] is quite hard to specialize, considering that array.array 
deals with 13 different item types based on its initial type argument. IMO 
specializing for it is only useful to bump benchmark numbers, but we won't see 
any real effects in real-world benchmarks.

--
messages: 414971
nosy: kj
priority: normal
severity: normal
status: open
title: Specialize list[slice]
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue46991>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46881] Statically allocate and initialize the latin1 characters.

2022-03-11 Thread Ken Jin


Ken Jin  added the comment:


New changeset 54ab9ad312ea53db40e31712454272e1d4c0315f by Jelle Zijlstra in 
branch 'main':
bpo-46881: Fix refleak from GH-31616 (GH-31805)
https://github.com/python/cpython/commit/54ab9ad312ea53db40e31712454272e1d4c0315f


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46881>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46939] Specialize calls for Python classes

2022-03-06 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +29827
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31707

___
Python tracker 
<https://bugs.python.org/issue46939>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46939] Specialize calls for Python classes

2022-03-06 Thread Ken Jin


New submission from Ken Jin :

Please see https://github.com/faster-cpython/ideas/issues/267.

I hope I'm not stepping on anyone's toes here (sorry if I cause any duplicate 
work)!

--
messages: 414618
nosy: Mark.Shannon, kj
priority: normal
severity: normal
status: open
title: Specialize calls for Python classes
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue46939>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-05 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46921>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-05 Thread Ken Jin


Ken Jin  added the comment:


New changeset 602024e6e12c69d836aa191d63db75862aec2493 by Ken Jin in branch 
'main':
bpo-46921: Vectorcall support for `super()` (GH-31687)
https://github.com/python/cpython/commit/602024e6e12c69d836aa191d63db75862aec2493


--

___
Python tracker 
<https://bugs.python.org/issue46921>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-04 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +29806
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31687

___
Python tracker 
<https://bugs.python.org/issue46921>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46921] Vectorcall support for super()

2022-03-04 Thread Ken Jin


New submission from Ken Jin :

This is related to bpo-46564. The changes are less ambitious but should produce 
a nice speedup.

--
messages: 414535
nosy: kj
priority: normal
severity: normal
status: open
title: Vectorcall support for super()
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue46921>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2022-02-01 Thread Ken Jin


Ken Jin  added the comment:

> In short, I will do my best, but I suspect I will need patience and guidance 
> in arriving something acceptable.

Yeah no worries. typing.py is really complex for many historical reasons. I 
still don't grasp all of it and probably never will.

> what about _AnnotatedAlias, _SpecialGenericAlias, _UnionGenericAlias, or 
> _strip_annotations?

They shouldn't need modification. And there's an elegant reason why. Currently 
ParamSpec is only valid in Generic, Callable and Concatenate. We don't care 
about any other types. As long as ParamSpec appears in their __parameters__ and 
the copy_with of those 3 have the correct settings.

Well what about when they're nested? The other types blindly copy over whatever 
they see in __parameters__ of any nested types. So even if you don't pass those 
settings to their copy_with, it doesn't matter (well of course, until someone 
else uses this setting and expands its scope, then proceeds to trip over it :(. 
this seems like a potential trap affecting PEP 646's runtime.)

>>> X = Concatenate[int, ParamSpec('P')]
>>> Container[X]
typing.Container[typing.Concatenate[int, ~P]]
>>> Container[X].copy_with(X).__parameters__
(~P,)
^ Works even though this uses _SpecialGenericAlias, which doesn't properly pass 
in the settings!

> I can't find any tests that deal with copy_with directly, so I'm assuming its 
> use is stressed via higher level code paths, but it's not clear what use 
> cases that method is supposed to serve.

Yeah. If you search for "copy_with" in typing.py. You'll find that it's called 
in __getitem__. Now __getitem__ is used when we subscript an already 
subscripted type. What I mean is:

T = TypeVar('T')
X = List[T] (__class_getitem__ is called, returning a new genericalias object)
X[int] (__getitem__ is called, returning a new genericalias object)

We need copy_with because we want to create a full "copy" of all the args into 
the new GenericAlias object and not face weird problems with mutability. That 
specific use case is tested super often.

> _ConcatenateGenericAlias.copy_with, on the other hand, appears to return a 
> tuple rather than a type until it falls back to the parent implementation. 
> What does one do with that?

Frankly, I was quite lost too until I saw that it was part of bpo-44791, which 
deals with special special (undefined) cases in PEP 612 and Concatenate. 
Basically for a very weird Concatenate, the core dev there has chosen to return 
a tuple of types instead of another type. Let's just ignore those strange tuple 
paths, and only care about the path using the parent implementation.

--

___
Python tracker 
<https://bugs.python.org/issue46581>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46564] Near zero-cost super().meth() calls via adaptive superinstructions

2022-02-01 Thread Ken Jin


Ken Jin  added the comment:


New changeset b9ebde8db7e176e021103745cd012bae700828b5 by Kumar Aditya in 
branch 'main':
bpo-46564: do not create frame object for super object (GH-31002)
https://github.com/python/cpython/commit/b9ebde8db7e176e021103745cd012bae700828b5


--

___
Python tracker 
<https://bugs.python.org/issue46564>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46482] `typing.Annotation.__new__` is not covered

2022-02-01 Thread Ken Jin


Ken Jin  added the comment:


New changeset 4c0612ad00ba45dbea2a86f7db6d21546cf243f8 by Nikita Sobolev in 
branch 'main':
bpo-46482: add a test for `typing.Annotation.__new__` (GH-30821)
https://github.com/python/cpython/commit/4c0612ad00ba45dbea2a86f7db6d21546cf243f8


--

___
Python tracker 
<https://bugs.python.org/issue46482>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46407] optimizing `1 << n` or `2 ** n` and modulo-only operations

2022-01-30 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj
nosy_count: 6.0 -> 7.0
pull_requests: +29206
pull_request: https://github.com/python/cpython/pull/31025

___
Python tracker 
<https://bugs.python.org/issue46407>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46571] Strange `@typing.no_type_check` behavior for class variables

2022-01-30 Thread Ken Jin


Ken Jin  added the comment:

I agree with Jelle, let's go with (2). It feels strange to have a decorator 
modify types that it doesn't own.

--

___
Python tracker 
<https://bugs.python.org/issue46571>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2022-01-30 Thread Ken Jin


Ken Jin  added the comment:

Wow! Thanks, that's an interesting find. My hunch is that we should be passing 
in _typevar_types and _paramspec_tvars in the copy_with of _GenericAlias and 
_ConcatenateGenericAlias. Inconsistent copy_with could trigger subtle bugs in 
ForwardRefs and get_type_hints. I can reproduce a semi-bug right now:

>>> P = ParamSpec('P')
>>> Callable[P, int].__parameters__
(~P,)
>>> Callable[P, int].copy_with((P,int))
typing.Callable[~P, int]
>>> Callable[P, int].copy_with((P,int)).__parameters__
()
^ This shouldn't be empty!!

Would you like to submit a patch for this?

--

___
Python tracker 
<https://bugs.python.org/issue46581>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-01-28 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +29186
pull_request: https://github.com/python/cpython/pull/31005

___
Python tracker 
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46564] Near zero-cost super().meth() calls via adaptive superinstructions

2022-01-28 Thread Ken Jin


Ken Jin  added the comment:

> Oh, I didn't see your PR and commented as it was not mentioned in this bpo.

No problem. In the future please check the "Pull Requests" section on the 
issue. People don't always say "I created a PR at xxx". Often times we just 
link the PR into the issue itself.

Keep your PR around in case mine gets rejected, then we can take just the good 
parts. If mine's accepted, we can close yours.

--

___
Python tracker 
<https://bugs.python.org/issue46564>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46564] Near zero-cost super().meth() calls via adaptive superinstructions

2022-01-28 Thread Ken Jin


Ken Jin  added the comment:

@Kumar, my PR already has your changes.

--

___
Python tracker 
<https://bugs.python.org/issue46564>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46560] ParamSpec: Typo in doc string

2022-01-28 Thread Ken Jin


Ken Jin  added the comment:

Thanks for the fix Zackery.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46560>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46560] ParamSpec: Typo in doc string

2022-01-28 Thread Ken Jin


Ken Jin  added the comment:


New changeset ffa505b580464d9d90c29e69bd4db8c52275280a by Zackery Spytz in 
branch 'main':
bpo-46560: Fix a typo in `typing.ParamSpec's` doc string (GH-30995)
https://github.com/python/cpython/commit/ffa505b580464d9d90c29e69bd4db8c52275280a


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46560>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46564] Near zero-cost super().meth() calls via adaptive superinstructions

2022-01-28 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +29172
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30992

___
Python tracker 
<https://bugs.python.org/issue46564>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46564] Near zero-cost super().meth() calls via adaptive superinstructions

2022-01-28 Thread Ken Jin


New submission from Ken Jin :

`super().meth()` is expensive. I propose to optimize 3 parts of this:

1. Avoid creating a temporary super() proxy object.
2. Avoid creating a bound method.
3. Avoid method lookup in super MRO using the inline cache.

Credit for 1. and 2. doesn't belong to me. Those were inspired by the excellent 
work done in issue43563.

I'll do this by combining the adjacent CALL (super) and LOAD_METHOD 
instructions into CALL_NO_KW_SUPER__LOAD_METHOD. Using the specializer means:

- We don't touch any compiler code.
- This custom instruction isn't revealed to the user
- I can make use of the 5 cache entries shared by both CALL_ADAPTIVE and 
LOAD_METHOD_ADAPTIVE.

The final 2-argument super(type, obj).meth() form will have almost no overhead 
over a corresponding self.meth() call in the current implementation.

Please see https://github.com/faster-cpython/ideas/issues/242 and 
https://github.com/faster-cpython/ideas/discussions/239 for more info.

--
assignee: kj
components: Interpreter Core
messages: 412005
nosy: Mark.Shannon, kj
priority: normal
severity: normal
status: open
title: Near zero-cost super().meth() calls via adaptive superinstructions
type: performance
versions: Python 3.11

___
Python tracker 
<https://bugs.python.org/issue46564>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46528] Simplify the VM's stack manipulations

2022-01-28 Thread Ken Jin


Ken Jin  added the comment:

> IIRC, Carl got a lot of benefit out of reordering the opcodes in the main 
> loop to put the most common ones at the top.  I don't know if that is still 
> relevant or whether computed gotos, when enabled, change that calculus.

AFAIK, on nix systems with PGO, the order doesn't matter. Brandt did some 
interesting research on this earlier 
https://github.com/faster-cpython/ideas/issues/96.

On Windows, it might be a different story. There are reports of up to 5% 
speedups in pyperformance just by moving LOAD_FAST and LOAD_GLOBAL out of the 
loop (to the top).  See the last few messages in 
https://bugs.python.org/issue45116. I've heard from some people that MSVC's PGO 
doesn't deal with gigantic switch-case statements very well, though I can't 
confirm the veracity of that info.

--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46528>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46533] Specialize for staticmethods and classmethods

2022-01-26 Thread Ken Jin


Ken Jin  added the comment:

Ah woops, my bad, I mixed up the two concepts. Thanks for the thorough 
explanation here!

--

___
Python tracker 
<https://bugs.python.org/issue46533>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46516] Use existing unbound_local_error label in DELETE_FAST opcode

2022-01-26 Thread Ken Jin


Ken Jin  added the comment:

Not sure why the merge message didn't appear here, but thanks!

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46516>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46529] Improve test coverage of `Union` and `Optional` repr()

2022-01-26 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46529>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46533] Specialize for staticmethods and classmethods

2022-01-26 Thread Ken Jin


Ken Jin  added the comment:

Slightly off topic rambling:

My own toy attempts at classmethod specialization suggested that it barely sped 
anything up. Most of the time went to creation of the new classmethod object. 
I'd imagine supporting Py_TPFLAGS_METHOD_DESCRIPTOR would speed things up, but 
they cover such a small % of calls that Py_TPFLAGS_METHOD_DESCRIPTOR's 
complexity might not be worth it.

Increasing specialization percentage is always a plus though. LOAD_METHOD needs 
better specialization success rates.

--

___
Python tracker 
<https://bugs.python.org/issue46533>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46529] Improve test coverage of `Union` and `Optional` repr()

2022-01-26 Thread Ken Jin


Ken Jin  added the comment:


New changeset d0c690b5f85c679de6059cf353fe0524e905530e by Nikita Sobolev in 
branch 'main':
bpo-46529: increase coverage of `typing.Union.__repr__` method (GH-30911)
https://github.com/python/cpython/commit/d0c690b5f85c679de6059cf353fe0524e905530e


--

___
Python tracker 
<https://bugs.python.org/issue46529>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46523] Test suite skips failing tests when setUp[Class] fails

2022-01-25 Thread Ken Jin


Change by Ken Jin :


--
title: Test suite skips failing tests -> Test suite skips failing tests when 
setUp[Class] fails

___
Python tracker 
<https://bugs.python.org/issue46523>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46523] Test suite skips failing tests

2022-01-25 Thread Ken Jin


Ken Jin  added the comment:

I vote for option 2.

--
nosy: +ezio.melotti, gvanrossum, kj

___
Python tracker 
<https://bugs.python.org/issue46523>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46519>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Ken Jin


Ken Jin  added the comment:


New changeset 9a7d01046723a8a0a10f9a26702c5e39e73d4414 by Ken Jin in branch 
'3.10':
[3.10] bpo-46445, bpo-46519: Re-import typing.NewType (GH-30886)
https://github.com/python/cpython/commit/9a7d01046723a8a0a10f9a26702c5e39e73d4414


--

___
Python tracker 
<https://bugs.python.org/issue46519>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-25 Thread Ken Jin


Ken Jin  added the comment:


New changeset 9a7d01046723a8a0a10f9a26702c5e39e73d4414 by Ken Jin in branch 
'3.10':
[3.10] bpo-46445, bpo-46519: Re-import typing.NewType (GH-30886)
https://github.com/python/cpython/commit/9a7d01046723a8a0a10f9a26702c5e39e73d4414


--

___
Python tracker 
<https://bugs.python.org/issue46445>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Ken Jin


Ken Jin  added the comment:

The test correctly fails on the first run in the CI, then skips itself on the 
second run, tricking the CI into thinking everything's passed. E.g. search for 
"test_typing" here 
https://github.com/python/cpython/runs/4902363883?check_suite_focus=true.

As to why it does that, I still have no clue.

--

___
Python tracker 
<https://bugs.python.org/issue46519>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +29068
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30886

___
Python tracker 
<https://bugs.python.org/issue46519>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46445] Multiple inheritance of TypedDict is not covered in `test_typing`

2022-01-25 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +29067
pull_request: https://github.com/python/cpython/pull/30886

___
Python tracker 
<https://bugs.python.org/issue46445>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46519] test_typing failing on branch 3.10

2022-01-25 Thread Ken Jin


Ken Jin  added the comment:

Thanks Matheus for the report. I can reproduce this too.

Unrelated: I'm confused why the CI checks passed on 3.10. Furthermore the 
buildbots aren't complaining.

--
nosy: +kj, sobolevn

___
Python tracker 
<https://bugs.python.org/issue46519>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46491] typing: allow Annotated in outermost scope

2022-01-25 Thread Ken Jin


Ken Jin  added the comment:

Thanks Gregory for fixing this!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46491>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2022-01-24 Thread Ken Jin


Ken Jin  added the comment:

> Wait... there's still PR 29479 open!

Sorry, I was too excited when PR 29335 merged and missed that. In the future, 
please re-open if you feel I closed an issue wrongly. Thanks!

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 
<https://bugs.python.org/issue45680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-24 Thread Ken Jin


Ken Jin  added the comment:


New changeset eaeb99468045b863d2dd3da3e3d1c3c9c78e1254 by Nikita Sobolev in 
branch '3.10':
[3.10] bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` 
(GH-30641) (GH-30697)
https://github.com/python/cpython/commit/eaeb99468045b863d2dd3da3e3d1c3c9c78e1254


--

___
Python tracker 
<https://bugs.python.org/issue46416>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46494] Mention typing_extensions in the typing documentation

2022-01-24 Thread Ken Jin


Ken Jin  added the comment:

Yes please, this is a great idea.

--
keywords: +easy, newcomer friendly

___
Python tracker 
<https://bugs.python.org/issue46494>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch

2022-01-24 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46470>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46396] `Concatenate` should not raise any semantic errors

2022-01-24 Thread Ken Jin


Ken Jin  added the comment:

I'm a little conflicted on this specific use case (but maybe I'm biased because 
I wrote the checks :).

I'm a strong proponent of less runtime checks. However, in this case, the 
exceptions serve as easy hints to the user, and they're meant to catch the most 
basic of errors. At the same time they barely add any overhead to our code.

Also, the last check may be required so that we can easily support subscripts 
(due to runtime quirks). I vaguely remember Serhiy mentioning that the 
semantics for subscripting a Callable[Concatenate[...], ...] is undefined by 
PEP 612. We were planning to formalize/reject the behavior, but I dropped the 
ball on that due to a lack of time. If that materializes, we're gonna raise an 
unclear runtime error about not enough typevars at subscript time anyways, so 
we might as well clearly tell the user at the start to prevent confusion.

--

___
Python tracker 
<https://bugs.python.org/issue46396>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46470] `_remove_dups_flatten` in `typing.py` contains dead branch

2022-01-24 Thread Ken Jin


Ken Jin  added the comment:


New changeset c144d9363107b50bcb0ccd01e7202e26a40c21f0 by Nikita Sobolev in 
branch 'main':
bpo-46470: remove unused branch from `typing._remove_dups_flatten` (GH-30780)
https://github.com/python/cpython/commit/c144d9363107b50bcb0ccd01e7202e26a40c21f0


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46470>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Ken Jin


Ken Jin  added the comment:

A short summary (thanks to Victor's findings!):

- os.kill(pid, signal.SIGINT) is specialized to CALL_NO_KW_FAST
- CALL_NO_KW_FAST doesn't check eval breaker, so the signal is ignored
- signal handler wasn't called, test fails

I'd like to add tests for some of the other CALL_X in the future, but I'm a 
little short on time at the moment, sorry! For now, I've tried to turn some of 
the tests "hot" to see if I can get those to trigger.

--

___
Python tracker 
<https://bugs.python.org/issue46465>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Ken Jin


Change by Ken Jin :


--
keywords: +patch
pull_requests: +29013
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30826

___
Python tracker 
<https://bugs.python.org/issue46465>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread Ken Jin


Ken Jin  added the comment:

Thanks @Victor for catching this and figuring it out. I had a hard time 
narrowing this down since I'm on Windows which doesn't support signals :(.

I'll handle the required patch and tests.

--

___
Python tracker 
<https://bugs.python.org/issue46465>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing`

2022-01-19 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10

___
Python tracker 
<https://bugs.python.org/issue46413>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2022-01-19 Thread Ken Jin

Ken Jin  added the comment:

Phew, we're finally done. Thanks Alex for the PRs, and Ɓukasz, Guido (and many 
others) for all the reviews!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue45680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2022-01-19 Thread Ken Jin


Ken Jin  added the comment:


New changeset 00645166b64e68001a425a15281a1ccdcb78f818 by Ken Jin in branch 
'3.9':
[3.9] bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) 
(GH-30689)
https://github.com/python/cpython/commit/00645166b64e68001a425a15281a1ccdcb78f818


--

___
Python tracker 
<https://bugs.python.org/issue45680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2022-01-19 Thread Ken Jin


Ken Jin  added the comment:


New changeset 1faf7c4effbe8b66f9b0347cab570fb3b5c91fb0 by Ken Jin in branch 
'main':
bpo-45680: Minor formatting fix in stdtypes.rst (GH-30690)
https://github.com/python/cpython/commit/1faf7c4effbe8b66f9b0347cab570fb3b5c91fb0


--

___
Python tracker 
<https://bugs.python.org/issue45680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46413] `__or__` is not covered for `_GenericAlias` and `_SpecialGenericAlias` in `typing`

2022-01-19 Thread Ken Jin


Ken Jin  added the comment:


New changeset 0a49148e87cca11e3820cbff2abfd316986a68c6 by Nikita Sobolev in 
branch 'main':
bpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` 
(GH-30640)
https://github.com/python/cpython/commit/0a49148e87cca11e3820cbff2abfd316986a68c6


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46413>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2022-01-19 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +2
pull_request: https://github.com/python/cpython/pull/30690

___
Python tracker 
<https://bugs.python.org/issue45680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2022-01-19 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +28887
pull_request: https://github.com/python/cpython/pull/30689

___
Python tracker 
<https://bugs.python.org/issue45680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2022-01-19 Thread Ken Jin


Ken Jin  added the comment:


New changeset 0eae9a2a2db6cc5a72535f61bb988cc417011640 by Alex Waygood in 
branch 'main':
bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335)
https://github.com/python/cpython/commit/0eae9a2a2db6cc5a72535f61bb988cc417011640


--

___
Python tracker 
<https://bugs.python.org/issue45680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46416] Direct invocation of `Lib/test/test_typing.py` fails

2022-01-19 Thread Ken Jin


Ken Jin  added the comment:


New changeset 2792d6d18eab3efeb71e6397f88db86e610541f1 by Nikita Sobolev in 
branch 'main':
bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641)
https://github.com/python/cpython/commit/2792d6d18eab3efeb71e6397f88db86e610541f1


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46416>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46424] `typing.Annotated` one type argument usage is not covered in tests

2022-01-18 Thread Ken Jin


Ken Jin  added the comment:


New changeset 32398294fb3fcf4ee74da54722fd0221c4e6cb74 by Nikita Sobolev in 
branch 'main':
bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663)
https://github.com/python/cpython/commit/32398294fb3fcf4ee74da54722fd0221c4e6cb74


--

___
Python tracker 
<https://bugs.python.org/issue46424>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46395] `Concatenate` is not covered to be a return type in `test_typing`

2022-01-16 Thread Ken Jin


Ken Jin  added the comment:

> In this case, do we need to make this a `TypeError`? Right now you can use 
> `Concatenate` as the return type.

Last I recall, we stopped checking anything in the param args of Callable since 
3.10 because it has too many problems with inter-version typing and 
typing_extensions usage. E.g. in Python 3.8

Callable[typing_extensions.Concatenate[...], ...]

was extremely difficult to implement in typing_extensions since Callable checks 
were too strict back then (they only allowed list of args). So to avoid such 
problems in the future, we ceased all param args checking.

For the return arg, I'm not too keen on adding more checks for the same reason 
of allowing future additions. Also the static type checker should warn the user 
and mypy correctly does that.

--

___
Python tracker 
<https://bugs.python.org/issue46395>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46395] `Concatenate` is not covered to be a return type in `test_typing`

2022-01-16 Thread Ken Jin


Ken Jin  added the comment:

Sorry I'm confused: Callable[..., Concatenate] is invalid usage. So I don't 
think we need to test it.

https://docs.python.org/3/library/typing.html#typing.Concatenate. "Concatenate 
is currently only valid when used as the first argument to a Callable."

--

___
Python tracker 
<https://bugs.python.org/issue46395>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46359] Continue to modernize `test_typing.py`

2022-01-13 Thread Ken Jin


Ken Jin  added the comment:


New changeset 8c49d057bf8618208d4ed67c9caecbfa71f7a2d0 by Nikita Sobolev in 
branch 'main':
bpo-46359: Modernize `test_typing` by removing checks for EOL Python versions 
(GH-30563)
https://github.com/python/cpython/commit/8c49d057bf8618208d4ed67c9caecbfa71f7a2d0


--

___
Python tracker 
<https://bugs.python.org/issue46359>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-01-12 Thread Ken Jin


Ken Jin  added the comment:

@Andreas
First of all, thanks for addressing my questions on the PR. I have one more 
question which I'll post here since it's not entirely related to your PR.

ForwardRef isn't meant to be explicitly instantiated by a user [1] (it's a 
typing internal class), so do you mind sharing what your current use case is 
please? My concern here is that exposing things in __repr__ would force us to 
keep `module` forever (I'm 100% fine with __eq__ and __hash__). After digging 
up the commit history, I now recall that the module parameter was used solely 
as a fix for ForwardRefs in different-module TypedDict (see GH-27017 or 
bpo-41249). It's not used anywhere else, so I don't know if your current use 
case was ever intended when the module parameter was added.

[1]: https://docs.python.org/3/library/typing.html#typing.ForwardRef

--

___
Python tracker 
<https://bugs.python.org/issue46333>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46244] typing._TypeVarLike missing __slots__

2022-01-10 Thread Ken Jin


Ken Jin  added the comment:


New changeset 081a2140083680ffc309e53699aea29e71760d70 by Arie Bovenberg in 
branch 'main':
bpo-46244: Remove __slots__ from typing.TypeVar, .ParamSpec (#30444)
https://github.com/python/cpython/commit/081a2140083680ffc309e53699aea29e71760d70


--

___
Python tracker 
<https://bugs.python.org/issue46244>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45665] Problems caused by isinstance(list[int], type) returning True

2022-01-04 Thread Ken Jin


Ken Jin  added the comment:

> It does seem inconsistent that Any is not considered a type but list[int] is

Yeah, almost none of the typing "types" are types ever since PEP 560. 
Issue45755 was a side effect too.

--

___
Python tracker 
<https://bugs.python.org/issue45665>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46244] typing._TypeVarLike missing __slots__

2022-01-04 Thread Ken Jin


Ken Jin  added the comment:

Good catch Arie. Would you like to submit a PR for this?

--

___
Python tracker 
<https://bugs.python.org/issue46244>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46104] Reduce use of old-style syntax in typing docs

2021-12-19 Thread Ken Jin


Ken Jin  added the comment:


New changeset 7c5c3f7254d78babcaf7a2ec187fd6ec53b8403c by Alex Waygood in 
branch 'main':
bpo-46104: Fix example broken by GH-30148 (GH-30203)
https://github.com/python/cpython/commit/7c5c3f7254d78babcaf7a2ec187fd6ec53b8403c


--

___
Python tracker 
<https://bugs.python.org/issue46104>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46130] Untranslatable link text in whatsnew/3.10

2021-12-19 Thread Ken Jin


Ken Jin  added the comment:

Thanks Rafael for your efforts in docs translations.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46130>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46130] Untranslatable link text in whatsnew/3.10

2021-12-19 Thread Ken Jin


Ken Jin  added the comment:


New changeset 3d3615f41f4ea73fe6707eb3673dfab482cb6a2b by Rafael Fontenelle in 
branch 'main':
bpo-46130: [docs] Add anchor for whatsnew/3.10 type hint section (GH-30199)
https://github.com/python/cpython/commit/3d3615f41f4ea73fe6707eb3673dfab482cb6a2b


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46130>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46113] Typos and minor fixes in built in types documentation

2021-12-18 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46113] Typos and minor fixes in built in types documentation

2021-12-18 Thread Ken Jin


Ken Jin  added the comment:


New changeset 0da17eb06943a66fcd826ff591d47c22c2c0595a by Miss Islington (bot) 
in branch '3.9':
bpo-46113: Minor fixes in stdtypes documentation (GH-30167) (GH-30187)
https://github.com/python/cpython/commit/0da17eb06943a66fcd826ff591d47c22c2c0595a


--

___
Python tracker 
<https://bugs.python.org/issue46113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46113] Typos and minor fixes in built in types documentation

2021-12-18 Thread Ken Jin


Ken Jin  added the comment:


New changeset bb286d45afa6740384bab97d0da68fe571efb6ec by Miss Islington (bot) 
in branch '3.10':
bpo-46113: Minor fixes in stdtypes documentation (GH-30167) (GH-30186)
https://github.com/python/cpython/commit/bb286d45afa6740384bab97d0da68fe571efb6ec


--

___
Python tracker 
<https://bugs.python.org/issue46113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46122] Update/fix types.UnionType to types.Union in Built-in Types documentation

2021-12-18 Thread Ken Jin


Ken Jin  added the comment:

Thanks for the PR Vivek. Can you please tell me the exact 3.10 version you're 
running? In earlier 3.10 versions (alpha, beta etc.) types.Union existed, but 
somewhere later (rc1,rc2) it became types.UnionType.

The final 3.10.0 release has types.UnionType, not types.Union. I suspect you 
might be running an earlier iteration of 3.10.

--
nosy: +kj
status: open -> pending

___
Python tracker 
<https://bugs.python.org/issue46122>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46113] Typos and minor fixes in built in types documentation

2021-12-18 Thread Ken Jin


Ken Jin  added the comment:


New changeset 6f2df4295123f8b961d49474b7668f7564a534a4 by Vivek Vashist in 
branch 'main':
bpo-46113: Minor fixes in stdtypes documentation (GH-30167)
https://github.com/python/cpython/commit/6f2df4295123f8b961d49474b7668f7564a534a4


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46113>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46104] Reduce use of old-style syntax in typing docs

2021-12-18 Thread Ken Jin


Ken Jin  added the comment:


New changeset 6ada013df170b0afb6b61a0d942388c6fd81cbc9 by Alex Waygood in 
branch 'main':
bpo-46104: Reduce use of pre-PEP 526 syntax in typing docs (GH-30148)
https://github.com/python/cpython/commit/6ada013df170b0afb6b61a0d942388c6fd81cbc9


--

___
Python tracker 
<https://bugs.python.org/issue46104>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Ken Jin


Ken Jin  added the comment:

Hi, I won't be backporting this to 3.9 since I don't like having jarring 
behavior changes so late into the bugfix cycle of a Python version.

I'm tempted to backport to 3.10. For now, I'll be conservative and just merge 
it in main. Please do tell me if any of you feel that I should backport to 3.10 
too.

3.6-3.8 are in security-fix only mode so they won't get any bugfixes.

Thanks Kevin for the interesting bug report, and Karthikeyan for saving me a 
ton of time debugging this!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue45755>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Ken Jin


Ken Jin  added the comment:


New changeset d6e13747161d7b634b47d2d3d212ed3be4a21fab by Ken Jin in branch 
'main':
bpo-45755: [typing] Reveal class attributes of generic in generic aliases in 
`dir()` (GH-29962)
https://github.com/python/cpython/commit/d6e13747161d7b634b47d2d3d212ed3be4a21fab


--

___
Python tracker 
<https://bugs.python.org/issue45755>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46097] Split function versions into 1-0xffff and 0x1000+ regions

2021-12-16 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46097>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-12-15 Thread Ken Jin


Ken Jin  added the comment:

Happened to a PR I was reviewing today:
https://github.com/python/cpython/runs/4535247255?check_suite_focus=true

--
keywords:  -patch
nosy: +kj
versions: +Python 3.11

___
Python tracker 
<https://bugs.python.org/issue41682>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46046] I/O bound threads got to no chance to run with small CPU bound threads with new GIL

2021-12-14 Thread Ken Jin


Ken Jin  added the comment:

Hi,

Thank you for your interest in Python, and especially the GIL. David Beazley 
opened an issue for his PyCon 2010 GIL talk at 
https://bugs.python.org/issue7946. You can discuss more on that issue (I 
suggest first reading through it, there's a really long history behind the GIL).

I'm closing this issue as a duplicate, as discussion should be redirected to 
the abovementioned issue7946 instead.

--
nosy: +kj
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46046>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46059] Typo in match Statement example

2021-12-14 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue46059>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46059] Typo in match Statement example

2021-12-14 Thread Ken Jin


Ken Jin  added the comment:


New changeset 1cbb88736c32ac30fd530371adf53fe7554be0a5 by Alex Waygood in 
branch 'main':
bpo-46059: Clarify pattern-matching example in "control flow" docs (GH-30079)
https://github.com/python/cpython/commit/1cbb88736c32ac30fd530371adf53fe7554be0a5


--
nosy: +kj

___
Python tracker 
<https://bugs.python.org/issue46059>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   >