Skip to content

@final and ParamSpec #12033

Closed
Closed

Description

@sobolevn

This code produces a strange error:

from typing import ParamSpec, Generic, final

_P = ParamSpec("_P")

@final  # E: Argument 1 to "final" has incompatible type "Type[_lru_cache_wrapper[Any]]"; expected "Type[_lru_cache_wrapper[Any]]"
class _lru_cache_wrapper(Generic[_P]):  
    pass

I will take a look, hopefully can fix it today.

Originally seen in python/typeshed#6986

Activity

  1. self-assigned this
    on Jan 21, 2022
  2. AlexWaygood commented on Apr 7, 2022

    @AlexWaygood
    Member

    The original error for this issue is no longer reproducible following @A5rocks's PR #11847. However, I'm not sure this issue should be closed yet, since @Akuli's PR #12096 may still be worth merging, as discussed in that PR thread and #11847 (comment)

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

Metadata

Metadata

Assignees

Labels

bugmypy got something wrongtopic-finalPEP 591topic-paramspecPEP 612, ParamSpec, Concatenate

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions