Skip to content

Update docs for "Import cycles" to refer to TYPE_CHECKING #2178

Closed

Description

@davidfstr

On the following page:

It is mentioned:

It is possible that in the future, mypy will change its dead code analysis and this trick will stop working. We will then offer an alternative, e.g. a constant defined by the typing module that is False at runtime but True while type checking.

The aforementioned constant now exists in the form of typing.TYPE_CHECKING. It might be useful to update the docs to refer to it, including in the example.

I could put a docs patch together if this is the correct approach.

Activity

  1. gvanrossum commented on Sep 24, 2016

    @gvanrossum
    Member
  2. davidfstr commented on Sep 25, 2016

    @davidfstr
    ContributorAuthor

    PR: #2181

  3. ddfisher commented on Sep 27, 2016

    @ddfisher
    Collaborator

    Fixed by #2181.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions