Skip to content

Commit cc976eb

Browse files
committed
Changed flag to --disallow-untyped-defs
1 parent 32acc8e commit cc976eb

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

mypy/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Disallow calling untyped functions from typed ones
5656
DISALLOW_UNTYPED_CALLS = 'disallow-untyped-calls'
5757
# Disallow defining untyped (or incompletely typed) functions
58-
DISALLOW_UNTYPED_FUNCS = 'disallow-untyped-funcs'
58+
DISALLOW_UNTYPED_DEFS = 'disallow-untyped-defs'
5959

6060
# State ids. These describe the states a source file / module can be in a
6161
# build.
@@ -386,7 +386,7 @@ def __init__(self, data_dir: str,
386386
modules,
387387
self.pyversion,
388388
DISALLOW_UNTYPED_CALLS in self.flags,
389-
DISALLOW_UNTYPED_FUNCS in self.flags)
389+
DISALLOW_UNTYPED_DEFS in self.flags)
390390
self.states = [] # type: List[State]
391391
self.module_files = {} # type: Dict[str, str]
392392
self.module_deps = {} # type: Dict[Tuple[str, str], bool]

mypy/checker.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ class TypeChecker(NodeVisitor[Type]):
367367
# This makes it an error to call an untyped function from a typed one
368368
disallow_untyped_calls = False
369369
# This makes it an error to define an untyped or partially-typed function
370-
disallow_untyped_funcs = False
370+
disallow_untyped_defs = False
371371

372372
def __init__(self, errors: Errors, modules: Dict[str, MypyFile],
373373
pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION,
374-
disallow_untyped_calls=False, disallow_untyped_funcs=False) -> None:
374+
disallow_untyped_calls=False, disallow_untyped_defs=False) -> None:
375375
"""Construct a type checker.
376376
377377
Use errors to report type check errors. Assume symtable has been
@@ -395,7 +395,7 @@ def __init__(self, errors: Errors, modules: Dict[str, MypyFile],
395395
self.pass_num = 0
396396
self.current_node_deferred = False
397397
self.disallow_untyped_calls = disallow_untyped_calls
398-
self.disallow_untyped_funcs = disallow_untyped_funcs
398+
self.disallow_untyped_defs = disallow_untyped_defs
399399

400400
def visit_file(self, file_node: MypyFile, path: str) -> None:
401401
"""Type check a mypy file with the given path."""
@@ -661,7 +661,7 @@ def check_func_def(self, defn: FuncItem, typ: CallableType, name: str) -> None:
661661
self.fail(messages.INIT_MUST_HAVE_NONE_RETURN_TYPE,
662662
item.type)
663663

664-
if self.disallow_untyped_funcs:
664+
if self.disallow_untyped_defs:
665665
# Check for functions with unspecified/not fully specified types.
666666
def is_implicit_any(t: Type) -> bool:
667667
return isinstance(t, AnyType) and t.implicit

mypy/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ def process_options(args: List[str]) -> Tuple[List[BuildSource], Options]:
180180
elif args[0] == '--disallow-untyped-calls':
181181
options.build_flags.append(build.DISALLOW_UNTYPED_CALLS)
182182
args = args[1:]
183-
elif args[0] == '--disallow-untyped-functions':
184-
options.build_flags.append(build.DISALLOW_UNTYPED_FUNCS)
183+
elif args[0] == '--disallow-untyped-defs':
184+
options.build_flags.append(build.DISALLOW_UNTYPED_DEFS)
185185
args = args[1:]
186186
elif args[0] in ('--version', '-V'):
187187
ver = True
@@ -318,7 +318,7 @@ def usage(msg: str = None) -> None:
318318
-s, --silent-imports don't follow imports to .py files
319319
--disallow-untyped-calls disallow calling functions without type annotations
320320
from functions with type annotations
321-
--disallow-untyped-funcs disallow defining functions without type annotations
321+
--disallow-untyped-defs disallow defining functions without type annotations
322322
or with incomplete type annotations
323323
--implicit-any behave as though all functions were annotated with Any
324324
-f, --dirty-stubs don't warn if typeshed is out of sync

typeshed

Submodule typeshed updated 50 files

0 commit comments

Comments
 (0)