Conversation
Fix incorrect line number comments in column/line test cases
To help facilitate the gradual addition of typing to existing codebases, Mypy by default will not type check dynamically typed functions (aka functions with no hints). Because our default behavior is solely to check for the presence of annotations, this can create a conflict when the lack of hints for a particular function is intentional. To support the use case of gradual addition of typing to a codebase, this introduces an `--allow-untyped-defs` flag to optionally suppress all errors from completely unannotated function definitions, similar to how Mypy provides the `--disallow-untyped-defs` flag to suppress the default behavior of ignoring dynamically typed functions.
Fix bug in checker logic where `is_dynamically_typed` method wasn't being called.
GhostofGoes
approved these changes
May 29, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
[v2.2.0]
Added
--allow-untyped-defsflag to optionally suppress all errors from dynamically typed functions. A function is considered dynamically typed if it does not contain any type hints.Fixed
Additional Details
Per #87: to help facilitate the gradual addition of typing to existing codebases, Mypy by default will not type check dynamically typed functions (aka functions with no hints). Because our default behavior is solely to check for the presence of annotations, this can create a conflict when the lack of hints for a particular function is intentional.
To support the use case of gradual addition of typing to a codebase, this release introduces an
--allow-untyped-defsflag to optionally suppress all errors from completely unannotated function definitions, similar to how Mypy provides the--disallow-untyped-defsflag to suppress its default behavior of ignoring dynamically typed functions.Closes #77
Closes #79
Closes #81
Closes #87