Skip to content

PEP 612 support #794

Closed
Closed

Description

@markedwards

Is there a schedule for adding support for PEP 612 (ParamSpec) to typing_extensions?

Activity

  1. JelleZijlstra commented on Apr 4, 2021

    @JelleZijlstra
    Member

    There is an open pull request: #774.

  2. markedwards commented on Apr 4, 2021

    @markedwards
    Author

    Thanks for the pointer @JelleZijlstra

  3. gvanrossum commented on Apr 5, 2021

    @gvanrossum
    Member
  4. JelleZijlstra commented on Apr 5, 2021

    @JelleZijlstra
    Member

    I will, I can ping you once I'm happy with it.

  5. JelleZijlstra commented on Apr 11, 2021

    @JelleZijlstra
    Member

    This has now been merged.

  6. markedwards commented on Apr 11, 2021

    @markedwards
    Author

    Thanks!

  7. markedwards commented on Oct 23, 2021

    @markedwards
    Author

    Following up on this, running mypy 0.910 and typing-extensions 3.10.0.2, I get errors with the documentation example for ParamSpec:

    import logging
    from collections.abc import Callable
    from typing import TypeVar
    
    from typing_extensions import ParamSpec
    
    T = TypeVar('T')
    P = ParamSpec('P')
    
    
    def add_logging(f: Callable[P, T]) -> Callable[P, T]:
    # mypy complains for the above line:
    #     The first argument to Callable must be a list of types or "..."
    
        def inner(*args: P.args, **kwargs: P.kwargs) -> T:
        # mypy complains for the above line:
        #     Name "P.args" is not defined
        #     Name "P.kwargs" is not defined
            logging.info(f'{f.__name__} was called')
            return f(*args, **kwargs)
        return inner

    Is it not possible to use ParamSpec in python 3.9?

  8. srittau commented on Oct 23, 2021

    @srittau
    Collaborator

    mypy 0.910 doesn't support ParamSpec yet.

  9. markedwards commented on Oct 23, 2021

    @markedwards
    Author

    @srittau Thanks, I see python/mypy#8645 now

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions