8000 Fix config file parsing of disallow_any/disallow_untyped_defs combination by JelleZijlstra · Pull Request #4076 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix config file parsing of disallow_any/disallow_untyped_defs combination #4076

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 4 commits into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add some missing annotations
  • Loading branch information
JelleZijlstra committed Oct 9, 2017
commit e97032d7f6813a6aae824bae263aa56dc399bbb6
2 changes: 1 addition & 1 deletion mypy/test/testcmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def cases(cls) -> List[DataDrivenTestCase]:
native_sep=True)
return c

def run_case(self, testcase: DataDrivenTestCase):
def run_case(self, testcase: DataDrivenTestCase) -> None:
test_python_evaluation(testcase)


Expand Down
2 changes: 1 addition & 1 deletion mypy/test/testpythoneval.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def cases(cls) -> List[DataDrivenTestCase]:
test_python_evaluation, test_temp_dir, True)
return c

def run_case(self, testcase: DataDrivenTestCase):
def run_case(self, testcase: DataDrivenTestCase) -> None:
test_python_evaluation(testcase)


Expand Down
2 changes: 1 addition & 1 deletion mypy/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ def __init__(self, link: Type) -> None:
def accept(self, visitor: 'TypeVisitor[T]') -> T:
return visitor.visit_forwardref_type(self)

def serialize(self):
def serialize(self) -> str:
if isinstance(self.link, UnboundType):
name = self.link.name
if isinstance(self.link, Instance):
Expand Down
5 changes: 5 additions & 0 deletions mypy_self_check.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ no_implicit_optional = True
disallow_any = generics, unimported
warn_redundant_casts = True
B05A warn_unused_ignores = True
warn_unused_configs = True

# historical exception
[mypy-mypy.semanal]
strict_optional = False

# needs py2 compatibility
Copy link
Member Author
@JelleZijlstra JelleZijlstra Oct 9, 2017

Choose a reason for hiding this comment

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

I'm not sure this is true, but the file is syntactically valid in Python 2 and it tests a piece of code (mypy_extensions.py) that is supposed to work in Python 2. @ilevkivskyi can you confirm?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this file supposed to run on both Python 3 and Python 2. There are still some problem with type checking it, but there is a separate issue for this #2755

[mypy-mypy.test.testextensions]
disallow_untyped_defs = False
0