[issue44524] __name__ attribute in typing module

2021-08-19 Thread Ken Jin
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

[issue38291] Deprecate the typing.io and typing.re pseudo-modules

2021-08-21 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +26327 pull_request: https://github.com/python/cpython/pull/27872 ___ Python tracker <https://bugs.python.org/issue38

[issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass

2021-08-22 Thread Ken Jin
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

[issue44975] [typing] Runtime protocols with ClassVar data members should support issubclass

2021-08-22 Thread Ken Jin
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

[issue45024] Cannot extend collections ABCs with protocol

2021-08-28 Thread Ken Jin
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

[issue44925] [docs] Confusing deprecation notice for typing.IO

2021-08-31 Thread Ken Jin
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

[issue44135] issubclass documentation doesn't explain tuple semantic

2021-08-31 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +26538 pull_request: https://github.com/python/cpython/pull/28095 ___ Python tracker <https://bugs.python.org/issue44

[issue36560] test_functools leaks randomly 1 memory block

2021-08-31 Thread Ken Jin
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

[issue45081] dataclasses that inherit from Protocol subclasses have wrong __init__

2021-09-02 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj, lukasz.langa, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45081> ___ ___ Python-bugs-list mailin

[issue45024] Cannot extend collections ABCs with protocol

2021-09-02 Thread Ken Jin
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

[issue45094] Consider using __forceinline and __attribute__((always_inline)) on static inline functions (Py_INCREF, Py_TYPE) for debug builds

2021-09-03 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue45094> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue44863] Allow TypedDict to inherit from Generics

2021-09-05 Thread Ken Jin
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

[issue45100] Teach help about typing.overload()

2021-09-05 Thread Ken Jin
Change by Ken Jin : -- nosy: +gvanrossum, kj ___ Python tracker <https://bugs.python.org/issue45100> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45107] Improve LOAD_METHOD specialization

2021-09-05 Thread Ken Jin
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

[issue45107] Improve LOAD_METHOD specialization

2021-09-05 Thread Ken Jin
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

[issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError

2021-09-07 Thread Ken Jin
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

[issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError

2021-09-08 Thread Ken Jin
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

[issue45121] Calling super().__init__ in subclasses of typing.Protocol raises RecursionError

2021-09-08 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +26653 pull_request: https://github.com/python/cpython/pull/28233 ___ Python tracker <https://bugs.python.org/issue45

[issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR

2021-09-15 Thread Ken Jin
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

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-16 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue45116> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue45227] Control reaches end of non-void function in specialize.c

2021-09-17 Thread Ken Jin
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

[issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR

2021-09-17 Thread Ken Jin
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

[issue45227] Control reaches end of non-void function in specialize.c

2021-09-17 Thread Ken Jin
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

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Ken Jin
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

[issue45107] Improve LOAD_METHOD specialization

2021-09-17 Thread Ken Jin
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

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-17 Thread Ken Jin
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

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-18 Thread Ken Jin
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

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-21 Thread Ken Jin
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) ==

[issue45256] Remove the usage of the cstack in Python to Python calls

2021-09-21 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue45256> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Ken Jin
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

[issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()`

2021-09-25 Thread Ken Jin
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

[issue45283] Top / function argument level ClassVar should not be allowed during `get_type_hints()`

2021-09-25 Thread Ken Jin
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: -

[issue45295] _PyObject_GetMethod/LOAD_METHOD for C classmethods

2021-09-26 Thread Ken Jin
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

[issue45295] _PyObject_GetMethod/LOAD_METHOD for C classmethods

2021-09-27 Thread Ken Jin
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

[issue45295] Speed up classmethod calls via LOAD_METHOD

2021-09-27 Thread Ken Jin
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

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread Ken Jin
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

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-29 Thread Ken Jin
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&

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-30 Thread Ken Jin
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

[issue45330] dulwich_log performance regression in 3.10

2021-09-30 Thread Ken Jin
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

[issue45330] dulwich_log performance regression in 3.10

2021-10-01 Thread Ken Jin
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

[issue45352] Move documentation for typed generic forms of standard collections to collections.abc

2021-10-03 Thread Ken Jin
Change by Ken Jin : -- nosy: +gvanrossum, kj, rhettinger, stutzbach ___ Python tracker <https://bugs.python.org/issue45352> ___ ___ Python-bugs-list mailin

[issue45352] Move documentation for typed generic forms of standard collections to collections.abc

2021-10-04 Thread Ken Jin
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

[issue45362] dis does not work with the new optimized ops

2021-10-04 Thread Ken Jin
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

[issue45362] dis does not work with the new optimized ops

2021-10-04 Thread Ken Jin
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

[issue45367] Specialize BINARY_MULTIPLY

2021-10-05 Thread Ken Jin
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

[issue45362] dis does not work with the new optimized ops

2021-10-05 Thread Ken Jin
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

[issue45415] Assert oparg < INSTR_OFFSET()

2021-10-08 Thread Ken Jin
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

[issue45418] types.UnionType is not subscriptable

2021-10-09 Thread Ken Jin
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

[issue45418] types.UnionType is not subscriptable

2021-10-10 Thread Ken Jin
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

[issue45203] Improve specialization stats for LOAD_METHOD and BINARY_SUBSCR

2021-10-10 Thread Ken Jin
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 __

[issue45418] types.UnionType is not subscriptable

2021-10-10 Thread Ken Jin
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

[issue45417] Enum creation non-linear in the number of values

2021-10-10 Thread Ken Jin
Change by Ken Jin : -- nosy: +barry, eli.bendersky, ethan.furman versions: +Python 3.9 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue45

[issue42345] Equality of typing.Literal depends on the order of arguments

2021-10-13 Thread Ken Jin
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

[issue45489] ForwardRef does not support | operator

2021-10-16 Thread Ken Jin
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

[issue45489] ForwardRef does not support | operator

2021-10-16 Thread Ken Jin
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:

[issue45330] dulwich_log performance regression in 3.10

2021-10-18 Thread Ken Jin
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

[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Ken Jin
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

[issue45527] Reduce overhead for cache hits in specialized opcodes.

2021-10-20 Thread Ken Jin
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

[issue45311] Threading Semaphore and BoundedSemaphore release method implementation improvement

2021-10-20 Thread Ken Jin
Change by Ken Jin : -- nosy: +pitrou, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45311> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42280] The list of standard generic collections is incomplete

2021-10-20 Thread Ken Jin
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

[issue43257] get_type_hints evaluates class variables before type hints

2021-10-20 Thread Ken Jin
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:

[issue44156] [subinterpreters] Replace static string caches with subinterpreter-compatible alternatives

2021-10-20 Thread Ken Jin
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

[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2021-10-20 Thread Ken Jin
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

[issue45565] More LOAD_ATTR specializations

2021-10-22 Thread Ken Jin
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.

[issue45565] More LOAD_ATTR specializations

2021-10-22 Thread Ken Jin
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

[issue41592] Make _SubParsersAction public

2021-10-22 Thread Ken Jin
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, ) --

[issue41592] Make _SubParsersAction public

2021-10-22 Thread Ken Jin
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'

[issue41592] Make _SubParsersAction public

2021-10-22 Thread Ken Jin
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

[issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations

2021-10-28 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +27535 pull_request: https://github.com/python/cpython/pull/29271 ___ Python tracker <https://bugs.python.org/issue44

[issue45648] Better tp_version_tag overflow checks in specializer

2021-10-28 Thread Ken Jin
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

[issue45648] Better tp_version_tag overflow checks in specializer

2021-10-28 Thread Ken Jin
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

[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread Ken Jin
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

[issue45664] resolve_bases() and new_class() do not work with type alias of a built-in type

2021-10-29 Thread Ken Jin
Change by Ken Jin : -- pull_requests: -27577 ___ Python tracker <https://bugs.python.org/issue45664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45655] List of PEPs at top of typing docs is too long to be readable

2021-10-29 Thread Ken Jin
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

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-10-30 Thread Ken Jin
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 --

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-11-01 Thread Ken Jin
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

[issue45666] Warning: "'swprintf' : format string '%s' requires an argument of type 'unsigned short *', but variadic argument 1 has type 'const char *'"

2021-11-01 Thread Ken Jin
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

[issue45633] Py_GT listed twice in Doc/extending/newtypes.rst

2021-11-02 Thread Ken Jin
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 --

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-11-03 Thread Ken Jin
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

[issue45633] Py_GT listed twice in Doc/extending/newtypes.rst

2021-11-03 Thread Ken Jin
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

[issue45633] Py_GT listed twice in Doc/extending/newtypes.rst

2021-11-03 Thread Ken Jin
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

[issue24139] Use sqlite3 extended error codes

2021-11-03 Thread Ken Jin
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

[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Ken Jin
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

[issue45633] Py_GT listed twice in Doc/extending/newtypes.rst

2021-11-03 Thread Ken Jin
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

[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-11-03 Thread Ken Jin
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

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

2021-11-03 Thread Ken Jin
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

[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-11-09 Thread Ken Jin
Change by Ken Jin : -- nosy: -kj ___ Python tracker <https://bugs.python.org/issue43656> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue42233] GenericAlias does not support union type expressions

2021-11-19 Thread Ken Jin
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

[issue45857] PEP 604 Union syntax does not support forward references

2021-11-22 Thread Ken Jin
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

[issue45947] Place dict (and values) pointers at a fixed (negative) offset from the base of the object.

2021-12-04 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue45947> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue43153] tempfile seems to treat a file as a directory when processing an exception in the onerror()

2021-12-06 Thread Ken Jin
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

[issue36392] IPv4Interface Object has no attributte prefixlen

2021-12-06 Thread Ken Jin
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

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

2021-12-06 Thread Ken Jin
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

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

2021-12-07 Thread Ken Jin
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

[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread Ken Jin
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

[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread Ken Jin
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

[issue45391] 3.10 objects.inv classifies UnionType as data

2021-12-09 Thread Ken Jin
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 --

[issue46020] Optimize long_pow for the common case

2021-12-09 Thread Ken Jin
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

[issue45391] 3.10 objects.inv classifies many types as data

2021-12-09 Thread Ken Jin
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

[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-11-30 Thread Ken Jin
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

<    1   2   3   4   5   6   >