Skip to content

Reduce use of Any unless dynamic typing expected #3532

Open

Description

@ngnpope

Follow up to a comment in #3528.

There is a lot of use of Any in various places where we should use something else.

In some cases we just haven't properly typed things and should probably consider using _typeshed.Incomplete.

It is also very common to default to using *args: Any and/or **kwargs: Any when neither are used within the function. If they are not used, or the function body doesn't care about their types, we should switch these to *args: object and **kwargs: object1. We could also consider use of _typeshed.Unused.

If it's also helpful, we can consider _typeshed.MaybeNone.

Using the aliases from typeshed helps to provide some context that we don't get with Any alone.

Footnotes

  1. This can be a little more complex where super() calls are involved. ↩

Activity

  1. added theissue type on Jul 27, 2026
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

    stubsIssues in stubs files (.pyi)

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions