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

Add flag to disallow partially annotated defs #3744

Merged
merged 5 commits into from Aug 2, 2017

Conversation

Projects
None yet
3 participants
@ilinum
Collaborator

ilinum commented Jul 20, 2017

This flag helps user remember to annotate the entire function instead of just
parts of it.
Fixes #3742

Add flag to disallow partially annotated defs
This flag helps user remember to annotate the entire function instead of just
parts of it.
Fixes #3742
@ilinum

This comment has been minimized.

Show comment
Hide comment
@ilinum

ilinum Jul 20, 2017

Collaborator

Perhaps, this flag needs to be enabled by default?
No functions in mypy/mypy are partially annotated and running mypy with the new flag on Dropbox internal codebases only produced a few extra errors.

That being said a lot of our tests have partially annotated functions, so some changes need to be done there.

Collaborator

ilinum commented Jul 20, 2017

Perhaps, this flag needs to be enabled by default?
No functions in mypy/mypy are partially annotated and running mypy with the new flag on Dropbox internal codebases only produced a few extra errors.

That being said a lot of our tests have partially annotated functions, so some changes need to be done there.

@JelleZijlstra

This comment has been minimized.

Show comment
Hide comment
@JelleZijlstra

JelleZijlstra Jul 20, 2017

Collaborator

I think there are also a lot of partially annotated functions in typeshed. I'd be open to disallowing them in typeshed though.

Collaborator

JelleZijlstra commented Jul 20, 2017

I think there are also a lot of partially annotated functions in typeshed. I'd be open to disallowing them in typeshed though.

@ddfisher

This comment has been minimized.

Show comment
Hide comment
@ddfisher

ddfisher Jul 20, 2017

Collaborator

Let's start with the flag off by default.

Collaborator

ddfisher commented Jul 20, 2017

Let's start with the flag off by default.

Show outdated Hide outdated docs/source/command_line.rst
Show outdated Hide outdated mypy/checker.py
Show outdated Hide outdated test-data/unit/check-flags.test
@ddfisher

LGTM!

@ddfisher ddfisher merged commit 1dc3f73 into python:master Aug 2, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ilinum ilinum deleted the ilinum:disallow-partially-annotated-defs branch Aug 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment