Skip to content

PEP 613 (Explicit Type Aliases) tracker #4913

Closed

Description

@srittau

This issue is supposed to track when we can start to use explicit type aliases (PEP 613) in typeshed. Support is needed in released versions of:

Activity

  1. changed the title [-]PEP 613 Explicit Type Aliases tracker[/-] [+]PEP 613 (Explicit Type Aliases) tracker[/+] on Jan 6, 2021
  2. srittau commented on Jan 6, 2021

    @srittau
    CollaboratorAuthor

    @rchen152 I am sorry for the mention spam, but does pytype support PEP 613? If not, would you mind me creating a ticket that we can reference from here?

  3. sproshev commented on Jan 6, 2021

    @sproshev
    Contributor

    Supported since PyCharm 2020.3 https://youtrack.jetbrains.com/issue/PY-42334

  4. rchen152 commented on Jan 7, 2021

    @rchen152
    Collaborator

    pytype doesn't support this yet. Opened google/pytype#787.

  5. srittau commented on Jun 14, 2021

    @srittau
    CollaboratorAuthor

    I used this simple script to test this feature.

    from typing_extensions import TypeAlias
    
    Alias1 = str
    Alias2: TypeAlias = str
    
    def foo() -> Alias1: pass
    def bar() -> Alias2: pass
    
    reveal_type(foo)
    reveal_type(bar)
  6. srittau commented on Dec 22, 2021

    @srittau
    CollaboratorAuthor

    mypy 0.930 now supports this.

  7. rchen152 commented on Mar 22, 2022

    @rchen152
    Collaborator

    pytype-2022.03.21 supports explicit type aliases.

  8. AlexWaygood commented on Mar 22, 2022

    @AlexWaygood
    Member

    Seems like there's nothing left to do here :)

  9. srittau commented on Mar 22, 2022

    @srittau
    CollaboratorAuthor

    Reopening as mypy still seems to have problems. #7534

  10. AlexWaygood commented on Mar 22, 2022

    @AlexWaygood
    Member

    @rchen152, #7534 also has several pytype errors, but they all look like valid type aliases to me — any idea what the problem is? :)

  11. rchen152 commented on Mar 22, 2022

    @rchen152
    Collaborator

    Whoops, that's embarrassing XD
    It looks almost like the type aliases aren't being stored at all - I'll investigate.

  12. srittau commented on Mar 30, 2022

    @srittau
    CollaboratorAuthor

    mypy and pytype are now fixed. 🎉

  13. laundmo commented on Apr 4, 2022

    @laundmo

    Does the closing of this issue mean that TypeAlias can now be used in TypeShed?

    if yes, this should probably be edited:

    typeshed/CONTRIBUTING.md

    Lines 241 to 242 in be64b01

    - [PEP 613](https://www.python.org/dev/peps/pep-0613/) (TypeAlias):
    see [#4913](https://github.com/python/typeshed/issues/4913)

  14. AlexWaygood commented on Apr 4, 2022

    @AlexWaygood
    Member

    Does the closing of this issue mean that TypeAlias can now be used in TypeShed?

    if yes, this should probably be edited:

    typeshed/CONTRIBUTING.md

    Lines 241 to 242 in be64b01

    - [PEP 613](https://www.python.org/dev/peps/pep-0613/) (TypeAlias):
    see [#4913](https://github.com/python/typeshed/issues/4913)

    It does — and yes, CONTRIBUTING does need to be edited :) I think the guidance on ParamSpec is also slightly out of date.

    PR welcome, if you'd like to help out!

  15. kkirsche commented on Jul 25, 2022

    @kkirsche
    Contributor

    Does the closing of this issue mean that TypeAlias can now be used in TypeShed?
    if yes, this should probably be edited:

    typeshed/CONTRIBUTING.md

    Lines 241 to 242 in be64b01

    - [PEP 613](https://www.python.org/dev/peps/pep-0613/) (TypeAlias):
    see [#4913](https://github.com/python/typeshed/issues/4913)

    It does — and yes, CONTRIBUTING does need to be edited :) I think the guidance on ParamSpec is also slightly out of date.

    PR welcome, if you'd like to help out!

    #8397 created to address this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: feature trackerTracks whether a typing feature can be used in typeshed stubs

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions