Skip to content

Make it possible to ignore annotations in certain files/directories #562

Closed

Description

@JukkaL

Maybe we need a configuration option to force certain modules to not be type checked (this would also allow arbitrary expressions in function annotations). This might be useful for legacy code that uses annotations -- and also for legacy code in general. The configuration option could be command line argument or a setting in a mypy configuration file, for example. By default, we could enable this for the Python std lib.

This was mentioned on python-ideas when discussing PEP 484.

An older idea is to not type check modules that don't import typing, but maybe that is too restrictive -- again, this was mentioned in the PEP 484 discussion.

Activity

  1. changed the title [-]Make it possible to ignore annotation in certain files/directories[/-] [+]Make it possible to ignore annotations in certain files/directories[/+] on Jan 28, 2015
  2. JelleZijlstra commented on Jul 1, 2017

    @JelleZijlstra
    Member

    Config files now support an ignore_errors = True option to ignore all errors in a file, so I think this can be closed.

  3. gvanrossum commented on Jul 1, 2017

    @gvanrossum
    Member

    No, pep 484 specifies# type: ignore which is still not implemented.

  4. JelleZijlstra commented on Jul 1, 2017

    @JelleZijlstra
    Member

    Then this is a dupe of #626.

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