Skip to content

_typeshed.Self doesn't work in third-party packages with mypy yet #5751

Closed
@JelleZijlstra

Description

@JelleZijlstra

I noticed while investigating #5750 that I got Any from a method associated as returning _typeshed.Self. I tracked down that it is because to mypy 0.910, _typeshed.Self doesn't exist yet because it's bundling an older version of the stdlib. The problem went away when I manually added Self to the installed stub file for _typeshed.

I see two options:

  • Ignore the problem and wait for the next mypy release to update typeshed. Until then, people will just see Any types from anything we annotate with Self in third-party packages.
  • Avoid using Self in third-party packages for now.

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