Skip to content

Replace --disallow-any flags with separate boolean flags. #4178

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

Merged
merged 2 commits into from
Oct 30, 2017

Conversation

ilinum
Copy link
Collaborator

@ilinum ilinum commented Oct 29, 2017

This PR also gets rid of --disallow-any=unannotated because it
is the same thing as --disallow-untyped-defs.

Fix #4089

This PR also gets rid of `--disallow-any=unannotated` because it
is the same thing as `--disallow-untyped-defs`.
Fix python#4089
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! I have a few new nits on the help strings, will post later.

mypy/main.py Outdated
parser.add_argument('--disallow-any-unimported', default=False, action='store_true',
help="disallow usage of types that come from unfollowed imports")
parser.add_argument('--disallow-any-expr', default=False, action='store_true',
help='disallow all expressions in the module that have type Any')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd drop "in the module" since that's implicit (and you don't say it for the other flags).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep!

mypy/main.py Outdated
help="disallow various types of Any in a module. Takes a comma-separated "
"list of options (defaults to all options disabled)")
parser.add_argument('--disallow-any-unimported', default=False, action='store_true',
help="disallow usage of types that come from unfollowed imports")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "disallow Any types resulting from unfollowed imports" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this seems reasonable! Done!

@gvanrossum gvanrossum merged commit bf90e2c into python:master Oct 30, 2017
@gvanrossum
Copy link
Member

Thanks! Now I have a whole bunch of internal mypy.ini files to clean up...

@ilinum ilinum deleted the split-disallow-any branch October 30, 2017 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants