[issue44524] __name__ attribute in typing module

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

[issue44957] typing docs: Mention PEP 604 syntax more prominently

2021-08-19 Thread Ken Jin
Ken Jin added the comment: Sure. Sebastian has created a really thorough PR at GH-27833 and I like it (with only one point for discussion). -- ___ Python tracker <https://bugs.python.org/issue44

[issue44914] tp_version_tag is not unique when test runs with -R :

2021-08-19 Thread Ken Jin
Ken Jin added the comment: I just realised I'm slightly wrong about identity checks -- there is a very very small chance where if the type object occupies the same address and the attribute is in a dynamically allocated __dict__ (and not some static slot), we can trick the checks

[issue44941] Add check_methods function to standard library

2021-08-19 Thread Ken Jin
Ken Jin added the comment: @finnjavier08 sorry, I'd misinterpreted your original message. Thanks for clarifying your intent! > I'd be happy to do the implementation and pull request once approval is given > and a module is decided on. I can't comment because I'm not an

[issue44926] typing.get_type_hints() raises for type aliases with forward references

2021-08-18 Thread Ken Jin
Ken Jin added the comment: > Ken Jin, can you guide Maximilian towards a successful doc update PR? It seems that Maximilian has already made some contributions to CPython, so I'm sure he's somewhat familiar with our workflow :). Nonetheless, @Maximilian if you need any help, please do p

[issue44937] test_regrest: test_tools_script_run_tests() failed on GHA Windows x64

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

[issue44941] Add check_methods function to collections.abc in standard library

2021-08-18 Thread Ken Jin
Change by Ken Jin : -- nosy: +rhettinger, stutzbach title: Add check_methods function to standard library -> Add check_methods function to collections.abc in standard library versions: +Python 3.11 ___ Python tracker <https://bugs.pyth

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

2021-08-18 Thread Ken Jin
Ken Jin added the comment: Yep! You can choose to add a new section under "Other concrete types", maybe "typing.io and typing.re submodules" then talk about how we could import from them in the past, but they're now deprecated and going to be removed. Alternati

[issue44889] Specialize LOAD_METHOD with PEP 659 adaptive interpreter

2021-08-17 Thread Ken Jin
Ken Jin added the comment: Some improvements can be made (see https://github.com/python/cpython/pull/27722#issuecomment-900369714), but for the most part we're done. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types

2021-08-17 Thread Ken Jin
Ken Jin added the comment: Thank you for the examples Serhiy. I agree. -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44914] tp_version_tag is not unique when test runs with -R :

2021-08-17 Thread Ken Jin
Ken Jin added the comment: @Pablo yup the 3.10 opcache used tp_version_tag. But it also does identity (pointer) comparison of type/class object https://github.com/python/cpython/blob/3.10/Python/ceval.c#L3432. Which is why it doesn't fail. I created this issue because we don't do type

[issue44914] tp_version_tag is not unique when test runs with -R :

2021-08-17 Thread Ken Jin
Ken Jin added the comment: Thanks Mark and Victor for the patch and reviews! This issue also affects 3.10, but IMO we don't need to backport this as we don't have other code relying on this invariant in that version, so it won't affect anything there. If you feel otherwise, please let me

[issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types

2021-08-17 Thread Ken Jin
Ken Jin added the comment: @Paul, Steve, Tim and Zach, I've removed y'all from nosy as this isn't a Windows issue (but a typing/builtin types one). If you feel that I shouldn't have done that: my apologies and please do tell me. To summarize what OP said: >>> isinstance(bool, (b

[issue44926] typing.get_type_hints() raises for type aliases with forward references

2021-08-16 Thread Ken Jin
Ken Jin added the comment: > 1. func1 doesn't crash, but also doesn't resolve the forward reference. I am > not sure if this expected behavior. Good observation! That's indeed the current behavior. The reason is a little subtle - list[...] is using a special builtin type

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

2021-08-16 Thread Ken Jin
Ken Jin added the comment: @rittneje, would you like to submit a PR for this? We can help if you'd like to. -- ___ Python tracker <https://bugs.python.org/issue44

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

2021-08-16 Thread Ken Jin
Change by Ken Jin : -- assignee: -> docs@python components: +Documentation -Library (Lib) keywords: +easy, newcomer friendly nosy: +docs@python, gvanrossum, kj, srittau title: Confusing deprecation notice for typing.IO -> [docs] Confusing deprecation notice for typing.IO ve

[issue44914] tp_version_tag is not unique when test runs with -R :

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

[issue44914] tp_version_tag is not unique when test runs with -R :

2021-08-15 Thread Ken Jin
Ken Jin added the comment: @Mark, agreed about properly defining the semantics. For the current bug: I've narrowed it down to a corner case in how the -R tests work: 1. On each run cleanup, libregrtest will clear the type cache https://github.com/python/cpython/blob

[issue44914] tp_version_tag is not unique when test runs with -R :

2021-08-14 Thread Ken Jin
New submission from Ken Jin : tp_version_tag is supposed to be unique for different class objects. Under normal circumstances, everything works properly: def good(): class C: def __init__(self): # Just to force `tp_version_tag` to update pass cls_id = hex(id(C

[issue44889] Specialize LOAD_METHOD with PEP 659 adaptive interpreter

2021-08-11 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +26207 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27722 ___ Python tracker <https://bugs.python.org/issu

[issue44889] Specialize LOAD_METHOD with PEP 659 adaptive interpreter

2021-08-11 Thread Ken Jin
New submission from Ken Jin : Possible specializations: - LOAD_METHOD_CACHED Cache the method. We only need to check that type(o) and o.__dict__ was not modified. - LOAD_METHOD_CLASS For classmethods. Less speedup expected. - LOAD_METHOD_MODULE For module methods. Uncommon (<10%). Ple

[issue44524] __name__ attribute in typing module

2021-08-05 Thread Ken Jin
Ken Jin added the comment: @Serhiy a summary from what I understand. I hope this helps: > I am confused. Why do these objects should have __name__ and __qualname__ > attributes? What document specifies this? I don't think any doc specifies this. The docs for __name__ and __qualname_

[issue44524] __name__ attribute in typing module

2021-08-05 Thread Ken Jin
Ken Jin added the comment: @Bas van Beek, thanks for testing numpy on 3.10rc1 and sending that link over. I was confused about what your original question entailed. The link provided much more context :). Seems that __name__ = None unintentionally breaks things that use annotations

[issue44524] __name__ attribute in typing module

2021-08-05 Thread Ken Jin
Ken Jin added the comment: > This PRs herein have created a situation wherein the > `__name__`/`__qualname__` attributes of certain typing objects can be `None`. > Is this behavior intentional? The affected objects are special forms which can hold types, so Union[],

[issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception

2021-08-03 Thread Ken Jin
Ken Jin added the comment: > Just chiming in to say that this is still broken for me on Python 3.9.6 >From what I understand, the patch landed on 2021-07-02, 4 days after Python >3.9.6's release date of 2021-06-28, so it wasn't included. It should come in 3.9.7, which should be ou

[issue44812] [docs] Document PyMember_{Get/Set}One in C API reference

2021-08-02 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +26061 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27555 ___ Python tracker <https://bugs.python.org/issu

[issue44812] [docs] Document PyMember_{Get/Set}One in C API reference

2021-08-02 Thread Ken Jin
New submission from Ken Jin : I can't seem to find PyMember_GetOne or PyMember_SetOne in C API docs, yet they are in stable_abi.txt. Sending a PR shortly, please tell me if these were accidentally exposed and not supposed to be documented (I will close the PR if so). -- assignee

[issue34422] __name__ not available for classes in typing module

2021-08-02 Thread Ken Jin
Ken Jin added the comment: Agree with Yurii. This is no longer an issue in 3.10 onwards. Thanks to Yurii for providing the fix in the other issue. -- nosy: +kj resolution: -> fixed stage: -> resolved status: open -> closed ___ Pytho

[issue44801] Type expression is coerced to a list of parameter arguments in substitution of ParamSpec

2021-08-01 Thread Ken Jin
Ken Jin added the comment: > Type expression is coerced to a list of parameter arguments in substitution > of ParamSpec. It's not, only the repr is like that. Internally it's not coerced. >>> C[int, str] typing.Callable[[int], str] >>> C[int, str].__args__ (, ) Be

[issue44791] Substitution of ParamSpec in Concatenate

2021-07-31 Thread Ken Jin
Ken Jin added the comment: Should Concatenate support substitution to begin with? PEP 612 doesn't say anything, and I am fairly certain it's a special typing form, not a generic. So I don't really understand what it means to substitute Concatenate. Then again, Callable with a nested

[issue44098] Remove ParamSpec from __parameters__ of most typing generics

2021-07-28 Thread Ken Jin
Ken Jin added the comment: @Serhiy, could you please briefly describe what you are planning? I'm guessing you're generalizing for _TypeVarLike? My main concern is that we should have as few differences between builtin and typing types as possible. typing.List is deprecated and set to remove

[issue44747] Refactor usage of sys._getframe at typing module

2021-07-28 Thread Ken Jin
Change by Ken Jin : -- title: Reduce usage of sys._getframe at typing module -> Refactor usage of sys._getframe at typing module ___ Python tracker <https://bugs.python.org/issu

[issue44021] enum docs in 3.10: missing "New in version 3.10"

2021-07-27 Thread Ken Jin
Ken Jin added the comment: I think we can close this. The current docs show the version added for the items in OP's list https://docs.python.org/3.11/library/enum.html. Their versionadded should be 3.11 now, but that's a separate issue with a PR at GH-27388. -- nosy: +kj

[issue44676] Add ability to serialise types.Union

2021-07-24 Thread Ken Jin
Ken Jin added the comment: This is fixed. Thanks Yurii and Serhiy for the patches :) (and everyone else for the reviews too). -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue44676] Add ability to serialise types.Union

2021-07-24 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +25878 pull_request: https://github.com/python/cpython/pull/27335 ___ Python tracker <https://bugs.python.org/issu

[issue44353] PEP 604 NewType

2021-07-24 Thread Ken Jin
Ken Jin added the comment: Thanks a bunch Yurii, Serhiy, Jelle, Ɓukasz and Pablo for working on this! I'm re-closing this issue. *Fingers-crossed* we won't have to open this again ;-). -- resolution: -> fixed status: open -> closed ___

[issue44731] Simplify implementation of the union type

2021-07-24 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25877 pull_request: https://github.com/python/cpython/pull/27334 ___ Python tracker <https://bugs.python.org/issue44

[issue44353] PEP 604 NewType

2021-07-24 Thread Ken Jin
Ken Jin added the comment: @Pablo, I don't think this change is causing the buildbots to fail. The test failure on all the currently failing buildbots is: == ERROR: test_absolute_circular_submodule

[issue44353] PEP 604 NewType

2021-07-24 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25865 pull_request: https://github.com/python/cpython/pull/27319 ___ Python tracker <https://bugs.python.org/issue44

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

2021-07-23 Thread Ken Jin
Change by Ken Jin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44353] PEP 604 NewType

2021-07-19 Thread Ken Jin
Ken Jin added the comment: > Does that work if you try to union two NewTypes? Oh woops I was too eager in closing this issue -- it doesn't work. Sorry, please disregard my previous message. I'm reopening this. Thanks for the reminder Jelle. -- resolution: out of date ->

[issue44353] PEP 604 NewType

2021-07-19 Thread Ken Jin
Ken Jin added the comment: This issue is now out of date on. After Serhiy's refactoring, any function types can be unioned. >>> NewType('x', int) >>> int | NewType('x', int) int | typing.NewType..new_type The only problem now is that the repr is weird, but Ser

[issue44662] Add ability to annotate types.Union

2021-07-19 Thread Ken Jin
Ken Jin added the comment: Nosied over people from issue44490. This issue addresses msg396895: Thanks to Ruben for the catch. (message copied over): ``` It also lacks the __module__ attribute, causing it to be unusable in PEP 593 typing.Annotated types: from typing import Annotated x

[issue44524] __name__ attribute in typing module

2021-07-19 Thread Ken Jin
Ken Jin added the comment: Yurii has a working PR for __name__ in _BaseGenericAlias, but not for _SpecialForm yet. Guido and/or Lukasz, do y'all think we should support __name__ and __qualname__ for special forms too? Personally I don't see how it'd hurt and I'm +1

[issue44653] Parameter substitution in the union type does not work with typing.Union

2021-07-19 Thread Ken Jin
Ken Jin added the comment: @Serhiy, this doesn't just affect typing.Union, it seems that the rest of the typing types don't substitute: >>> (int | T)[typing.List[str]] Traceback (most recent call last): File "", line 1, in TypeError: Each union arg must be a type, got t

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-18 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25763 pull_request: https://github.com/python/cpython/pull/27222 ___ Python tracker <https://bugs.python.org/issue44

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-17 Thread Ken Jin
Change by Ken Jin : -- pull_requests: -25752 ___ Python tracker <https://bugs.python.org/issue44490> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44659] Remove Ivan from list of typing experts

2021-07-17 Thread Ken Jin
Ken Jin added the comment: Thank you for everything you've done over the years for typing and its ecosystem Ivan. Take care, and please don't hesitate to add yourself back in the future if you feel like it. -- ___ Python tracker <ht

[issue20291] Argument Clinic should understand *args and **kwargs parameters

2021-07-17 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj nosy_count: 10.0 -> 11.0 pull_requests: +25749 pull_request: https://github.com/python/cpython/pull/27211 ___ Python tracker <https://bugs.python.org/issu

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-16 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25739 pull_request: https://github.com/python/cpython/pull/27205 ___ Python tracker <https://bugs.python.org/issue41

[issue44659] Remove Ivan from list of,typing experts

2021-07-16 Thread Ken Jin
Ken Jin added the comment: The list for GH reviews is the CODEOWNERS file at https://github.com/python/cpython/blob/main/.github/CODEOWNERS The list for grouping bpo users is the experts index (I hope) at https://devguide.python.org/experts/ Let's wait a bit to hear what Ivan wants. I

[issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules

2021-07-16 Thread Ken Jin
Ken Jin added the comment: > How far can/should we backport this? It will work in 3.10 and 3.9 without issues. However, I don't remember if bugfixes for __future__ features require special treatment/are excluded from normal bugfix backports. I vaguely remember us not backporting f

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-07-16 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25737 pull_request: https://github.com/python/cpython/pull/27203 ___ Python tracker <https://bugs.python.org/issue44

[issue44654] Refactor and clean up the union type implementation

2021-07-16 Thread Ken Jin
Ken Jin added the comment: > I am going to backport these changes to 3.10 to make backporting of future > fixes easier. > * Move declarations of _Py_make_parameters and _Py_subs_parameters ... Unfortunately, _Py_make_parameters and _Py_subs_parameters are 3.11 only. They were part

[issue44652] Preserve natural order of args in the union type

2021-07-16 Thread Ken Jin
Change by Ken Jin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44642] Union of a type and the typing module function

2021-07-15 Thread Ken Jin
Ken Jin added the comment: @Serhiy > 1. Make NewType a class and add more strict test. See also: issue44353 (https://bugs.python.org/issue44353). We had some discussion there about converting to class but it ended in a deadlock. -- ___ Pyt

[issue44635] Convert None to NoneType in the union type constructor

2021-07-14 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25683 pull_request: https://github.com/python/cpython/pull/27141 ___ Python tracker <https://bugs.python.org/issue44

[issue44632] Union with TypeVar does not work as intended

2021-07-14 Thread Ken Jin
Ken Jin added the comment: Oh this is a fun one :). > The code for recognizing TypeVars must be wrong. Is it also wrong in e.g. > list[T]? list[T] is correct. I was pretty puzzled since I thought their code is nearly the same, but then I noticed a subtle difference -- GenericAlias

[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Ken Jin
Ken Jin added the comment: > 3. There is also a crash in isinstance(): That's unfortunate :(. Serhiy, thanks for catching all these bugs in union. I recently realized you probably made 50% of all bug reports for union and they're very much appreciated :). > Converting None to typ

[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Ken Jin
Ken Jin added the comment: @Serhiy, can I work on converting None to type(None) please? -- ___ Python tracker <https://bugs.python.org/issue44606> ___ ___ Pytho

[issue44606] Discrepancy between isinstance() and issubclass() for union types

2021-07-13 Thread Ken Jin
Ken Jin added the comment: @Serhiy > 2. Different handling of virtual subclasses: This looks like a bug. I think the union form of isinstance/issubclass should have the same behavior as the tuple form. We promise checking of virtual classes in the docs for union types: ht

[issue44353] PEP 604 NewType

2021-07-12 Thread Ken Jin
Ken Jin added the comment: @Yurii, I would like to caution against a C accelerator for the typing module. My reasoning follows: 1. The maintenance burden is higher. typing is already somewhat complex in Python (lots of MRO/metaclass wizardry). A C module would require knowledge of the C

[issue44479] Windows build doesn't regenerate some files

2021-07-07 Thread Ken Jin
Ken Jin added the comment: @Steve, after this change, the Azure Pipelines commit CI's appx tests started failing on main and 3.10. https://dev.azure.com/Python/cpython/_build/results?buildId=83619=results == FAIL

[issue44578] dict/list with more than two type parameters doesn't raise a TypeError

2021-07-07 Thread Ken Jin
Ken Jin added the comment: Sorry, I don't think this will be fixed as it is intentional. types.GenericAlias (the type of list[int] or dict[str, str]) does almost 0 checking for two reasons IIUC: - Types with wrong number of parameters will usually be caught by your IDE/type checker

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

2021-07-05 Thread Ken Jin
Ken Jin added the comment: > This change seems to emit deprecation warnings in test_pydoc. test_typing emits them too as it tests importing things from __all__. -- ___ Python tracker <https://bugs.python.org/issu

[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-05 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25587 pull_request: https://github.com/python/cpython/pull/27028 ___ Python tracker <https://bugs.python.org/issue44

[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-04 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +25575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27016 ___ Python tracker <https://bugs.python.org/issu

[issue44562] types.GenericAlias should decref instead of using delete in tp_new

2021-07-04 Thread Ken Jin
New submission from Ken Jin : Ref: comment chain at https://github.com/python/cpython/pull/27008#discussion_r663450441. setup_ga fails only if PyTuple_Pack fails, which usually happens when Python is out of memory. The cleanup code for setup_ga shouldn't use PyObject_GC_DEL as mentioned

[issue44553] types.Union should support GC

2021-07-03 Thread Ken Jin
Ken Jin added the comment: Oh I didn't see Pablo's message on the PR: > @Fidget-Spinner For next occasions, the problem with this is that > PyObject_GC_Del cannot be called like that because it overrides a bunch of > cleanups like the call to _Py_ForgetReference and other possible

[issue44553] types.Union should support GC

2021-07-03 Thread Ken Jin
Ken Jin added the comment: Woops, thanks for the quick fix Pablo. I'm guessing the takeaway here is that we should start tracking a GC-ed object as early as possible? -- ___ Python tracker <https://bugs.python.org/issue44

[issue44553] types.Union should support GC

2021-07-03 Thread Ken Jin
Ken Jin added the comment: Thanks for the helpful review and merge Serhiy. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception

2021-07-02 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj nosy_count: 12.0 -> 13.0 pull_requests: +2 pull_request: https://github.com/python/cpython/pull/26994 ___ Python tracker <https://bugs.python.org/issu

[issue44553] types.Union should support GC

2021-07-02 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +25554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26993 ___ Python tracker <https://bugs.python.org/issu

[issue44553] types.Union should support GC

2021-07-02 Thread Ken Jin
New submission from Ken Jin : types.Union objects can contain reference cycles, therefore causing memory leaks. E.g.:: ``` import sys, gc from typing import TypeVar gc.collect() for _ in range(10): sys.gettotalrefcount() T = TypeVar('T') U = int | list[T] T.blah = U del T del U

[issue44541] collections.abc.Sequence index implementation

2021-06-30 Thread Ken Jin
Ken Jin added the comment: Closing this issue since OP(Maciej) has marked it as "not a bug". -- nosy: +kj stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.py

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-06-29 Thread Ken Jin
Ken Jin added the comment: I don't think we need the types.GenericAlias(int | list[T], str) workaround. GenericAlias already has code for extracting __parameters__ and implementing __getitem__. Someone would need to refactor and reuse them for Union too. That should be enough to trick

[issue44524] __name__ attribute in typing module

2021-06-29 Thread Ken Jin
Ken Jin added the comment: Lars, yes you're right that __name__ is documented in datamodel, sorry I wasn't clear in my original message. What I meant was that specifically for the typing module, it's not exposed anywhere in its docs https://docs.python.org/3/library/typing.html. > If I w

[issue44524] __name__ attribute in typing module

2021-06-29 Thread Ken Jin
Ken Jin added the comment: > Is this intentional? It seems a little inconsistent. The `__name__` attribute is for internal use only. It's subject to change every release along with other implementation details. Sorry, I don't really understand what this issue is requesting. Do you w

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-06-29 Thread Ken Jin
Ken Jin added the comment: Yurii, thanks for the offer. We only need to implement __getitem__ if union supports TypeVars. Which means __parameters__ need to be implemented too (or at least a private internal implementation of it). I interpreted Guido's message above as to wait and see

[issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations

2021-06-28 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +25503 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26934 ___ Python tracker <https://bugs.python.org/issu

[issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations

2021-06-28 Thread Ken Jin
New submission from Ken Jin : CALL_FUNCTION can be specialized. Copying from Mark's comments https://github.com/faster-cpython/ideas/issues/54#issue-898013125 ``` There are a number of specializations of CALL_FUNCTION that make sense: 1. Calls to a Python function where the arguments

[issue44483] Fatal error in type union

2021-06-23 Thread Ken Jin
Ken Jin added the comment: Oh, that's a good point too. Thanks for the explanation, reviews and merge Serhiy. -- ___ Python tracker <https://bugs.python.org/issue44

[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-22 Thread Ken Jin
Change by Ken Jin : -- pull_requests: -25430 ___ Python tracker <https://bugs.python.org/issue38323> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2021-06-22 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj nosy_count: 10.0 -> 11.0 pull_requests: +25430 pull_request: https://github.com/python/cpython/pull/26848 ___ Python tracker <https://bugs.python.org/issu

[issue44490] PEP 604 Union (int | str) doesn't have __parameters__

2021-06-22 Thread Ken Jin
New submission from Ken Jin : Recently I noticed that the new PEP 604 Union type doesn't collect type variables: from typing import TypeVar T = TypeVar('T') (int | list[T]).__parameters__ Traceback (most recent call last): File "", line 1, in AttributeError: 'types.Union'

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

2021-06-22 Thread Ken Jin
Ken Jin added the comment: @Sebastian, Woops, thanks for the reminder. I think both options are fine. But I'm leaning towards creating a new issue. The title of the current issue is "Deprecate the typing.io and typing.re pseudo-modules" not "Remove the typing.io and ty

[issue44483] Fatal error in type union

2021-06-22 Thread Ken Jin
Ken Jin added the comment: A possible simple fix is to change these lines https://github.com/python/cpython/blob/main/Objects/unionobject.c#L294-L301 to: ``` return ( is_typevar(obj) | is_new_type(obj) | is_special_form(obj) | PyType_Check(obj

[issue44483] Fatal error in type union

2021-06-22 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch nosy: +kj nosy_count: 1.0 -> 2.0 pull_requests: +25429 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26848 ___ Python tracker <https://bugs.python.org/i

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

2021-06-22 Thread Ken Jin
Ken Jin added the comment: That specific buildbot is now green. Thanks everyone :)! https://dev.azure.com/Python/cpython/_build/results?buildId=82931=results I'm closing the issue now as it seems there isn't anything left to do. -- resolution: -> fixed stage: patch rev

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-22 Thread Ken Jin
Ken Jin added the comment: > Ken, if you feel like it, a fix should not be too complicated, right? Yup. Will's proposal is to change the try-except to: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) @Will, would you like to submit a PR for this? You'd n

[issue44477] Remove ma_version_tag in dict?

2021-06-21 Thread Ken Jin
Ken Jin added the comment: Closing this for now as it seems PEP 509 may need to be repealed: https://github.com/faster-cpython/ideas/issues/30#issuecomment-858615678 Sorry for the noise everyone :(. -- resolution: -> postponed stage: patch review -> resolved status: open -&g

[issue44477] Remove ma_version_tag in dict?

2021-06-21 Thread Ken Jin
Ken Jin added the comment: Hmm I'm suddenly having second thoughts. I wonder if there's future use cases I might be missing here from PEP 509? -- nosy: +vstinner ___ Python tracker <https://bugs.python.org/issue44

[issue44477] Remove ma_version_tag in dict?

2021-06-21 Thread Ken Jin
Change by Ken Jin : -- keywords: +patch pull_requests: +25414 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26833 ___ Python tracker <https://bugs.python.org/issu

[issue44477] Remove ma_version_tag in dict?

2021-06-21 Thread Ken Jin
New submission from Ken Jin : issue44206, issue44337, and issue44338 converted things dependent on ma_version_tag to ma_keys->dk_version. I propose to remove ma_version_tag and save 8 bytes of space in dict. I've prepared a draft PR to do that. However, I'd like to wait for some time bef

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-21 Thread Ken Jin
Ken Jin added the comment: Will, I think what you say makes sense. @Guido / Ivan / Jelle What do you think? -- nosy: +Jelle Zijlstra, gvanrossum, kj, levkivskyi ___ Python tracker <https://bugs.python.org/issue44

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

2021-06-21 Thread Ken Jin
Ken Jin added the comment: > Overall it looks as if the the Azure pipeline should be fixed, though. It's > not ideal that the tests pass while running the PR, but not in other > situations. I agree. This specific test only seems to run *after* a commit is made. I don't see a w

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

2021-06-20 Thread Ken Jin
Change by Ken Jin : -- pull_requests: +25393 pull_request: https://github.com/python/cpython/pull/26811 ___ Python tracker <https://bugs.python.org/issue38

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

2021-06-20 Thread Ken Jin
Ken Jin added the comment: Hello Sebastian, the tests are failing on the Azure pipelines buildbot running appx tests: https://dev.azure.com/Python/cpython/_build/results?buildId=82827=logs=0fcf9c9b-89fc-526f-8708-363e467e119e=fa5ef4ee-3911-591e--19482ab189b7 I suspect it's the same

[issue16437] issubclass doc improvement

2021-06-16 Thread Ken Jin
Ken Jin added the comment: @irit, you may be interested in issue44135, there's an open PR there and it seems to fix what this issue describes. -- nosy: +kj ___ Python tracker <https://bugs.python.org/issue16

[issue44392] Py_GenericAlias is not documented

2021-06-16 Thread Ken Jin
Ken Jin added the comment: I'm closing this issue as all the relevant PRs have landed. Thanks everyone! @Ronald > Why should this be deprecated at all? I can't speak for others, but personally I think it's here to stay (for the many reasons raised in the previous messages). Tha

<    1   2   3   4   5   6   >