Skip to content

Don't require type annotations for locals when using --check-untyped-defs #8558

Open

Description

@rggjan

Trying to reopen or clone #7744 but didn't figure out how, so I created a new issue instead.

See #7744 for all the required information.

Activity

  1. JukkaL commented on Mar 20, 2020

    @JukkaL
    Collaborator

    The issue is about cases like this, which currently generate an error:

    def foo():
        data = { # error: Need type annotation for 'data'
            'abc': {}
        }
    

    I think that not generating an error here should just be the default behavior. This would be a logical continuation of changes introduced in #7530.

  2. changed the title [-]--check-untyped-defs-lite[/-] [+]Don't require type annotations for locals when using --check-untyped-defs[/+] on Mar 20, 2020
  3. JukkaL commented on Mar 20, 2020

    @JukkaL
    Collaborator

    @msullivan @ilevkivskyi Do you agree with me?

  4. ilevkivskyi commented on Mar 23, 2020

    @ilevkivskyi
    Member

    If the function itself has no annotations then yes, it would make sense to not require annotations for locals.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions