FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Returning `Unknown` instead of `Any` for incomplete `__getattr__` · Issue #13765 · python/typeshed · GitHub

Repository navigation

Returning Unknown instead of Any for incomplete __getattr__ #13765

Closed

Description

I noticed we have quite a few

def __getattr__(name: str) -> Incomplete: ...

Wouldn't it be better to write as

def __getattr__(name: str): ...  # incomplete

So that type-checkers like Pyright in strict mode can warn about unknown types ?

Activity

  1. srittau commented on Apr 2, 2025

    Collaborator

    I think that was a pattern mandated in CONTRIBUTING for incomplete stubs. I think the current pattern just happened via the route

    1. -> Any: ... # incomplete
    2. -> Incomplete: ... # incomplete
    3. -> Incomplete: ...

    That said, I don't have a strong preference either way.

  2. added a commit that references this issue on May 12, 2025
    0e4e0ad
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: policyOrganization of the typeshed projectstubs: false negativeType checkers do not report an error, but should

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL