Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle code guarded by 'if TYPE_CHECKING' correctly #530

Closed
wants to merge 17 commits into from

Commits on Apr 15, 2020

  1. Omit code guarded by 'if TYPE_CHECKING'

    This commit finds a problem that has been observed in read code.
    
    Consider the following code:
    
    ```
    from typing import TYPE_CHECKING
    ...
    if TYPE_CHECKING
        from a import A, B
        from b import C
    
    ...
    def f() -> "B":
        ...
    
    def f()
        # Oops! C is actually used here.
        C()
    ```
    
    This commit ignores all code that is guarded by TYPE_CHECKING in
    order to find mistakes like this. This constant is always False
    when mypy is not running anyway.
    PetterS committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    44aab70 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d66aeb8 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2020

  1. Remove constructor arg.

    PetterS committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    3b60143 View commit details
    Browse the repository at this point in the history
  2. Another solution.

    PetterS committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    a6f0dd2 View commit details
    Browse the repository at this point in the history
  3. Revert "Another solution."

    This reverts commit a6f0dd2.
    PetterS committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    b938b2b View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2020

  1. Configuration menu
    Copy the full SHA
    3474adf View commit details
    Browse the repository at this point in the history
  2. Fix Python 2.7

    PetterS committed Apr 19, 2020
    Configuration menu
    Copy the full SHA
    b8e687a View commit details
    Browse the repository at this point in the history
  3. Snake case.

    PetterS committed Apr 19, 2020
    Configuration menu
    Copy the full SHA
    a30cfcb View commit details
    Browse the repository at this point in the history
  4. Rename to for_annotations

    PetterS committed Apr 19, 2020
    Configuration menu
    Copy the full SHA
    7306c2b View commit details
    Browse the repository at this point in the history
  5. Flake8

    PetterS committed Apr 19, 2020
    Configuration menu
    Copy the full SHA
    12fd45a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    aeaf0b6 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2020

  1. Configuration menu
    Copy the full SHA
    f5657ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a993d91 View commit details
    Browse the repository at this point in the history

Commits on May 13, 2020

  1. Configuration menu
    Copy the full SHA
    7eb8484 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2021

  1. Configuration menu
    Copy the full SHA
    a9d4a7f View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2021

  1. Review

    PetterS committed Mar 26, 2021
    Configuration menu
    Copy the full SHA
    558914b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cbe214a View commit details
    Browse the repository at this point in the history