Skip to content

Commit 2fffdb2

Browse files
committed
Fix lint warnings: W293 blank line contains whitespace
1 parent 923d496 commit 2fffdb2

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

mypy/checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,7 @@ def visit_newtype_expr(self, e: NewTypeExpr) -> Type:
20702070
def visit_namedtuple_expr(self, e: NamedTupleExpr) -> Type:
20712071
# TODO: Perhaps return a type object type?
20722072
return AnyType()
2073-
2073+
20742074
def visit_typeddict_expr(self, e: TypedDictExpr) -> Type:
20752075
# TODO: Perhaps return a type object type?
20762076
return AnyType()

mypy/nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ class is generic then it will be a type constructor of higher kind.
18481848

18491849
# Is this a named tuple type?
18501850
is_named_tuple = False
1851-
1851+
18521852
# Is this a typed dict type?
18531853
is_typed_dict = False
18541854

mypy/semanal.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ def analyze_types(self, items: List[Node]) -> List[Type]:
17791779
self.fail('Type expected', node)
17801780
result.append(AnyType())
17811781
return result
1782-
1782+
17831783
def process_typeddict_definition(self, s: AssignmentStmt) -> None:
17841784
"""Check if s defines a TypedDict; if yes, store the definition in symbol table."""
17851785
if len(s.lvalues) != 1 or not isinstance(s.lvalues[0], NameExpr):
@@ -1793,7 +1793,7 @@ def process_typeddict_definition(self, s: AssignmentStmt) -> None:
17931793
node = self.lookup(name, s)
17941794
node.kind = GDEF # TODO locally defined TypedDict
17951795
node.node = typed_dict
1796-
1796+
17971797
def check_typeddict(self, node: Node, var_name: str = None) -> Optional[TypeInfo]:
17981798
"""Check if a call defines a TypedDict.
17991799
@@ -1828,7 +1828,7 @@ def check_typeddict(self, node: Node, var_name: str = None) -> Optional[TypeInfo
18281828
self.globals[name] = SymbolTableNode(GDEF, info, self.cur_mod_id)
18291829
call.analyzed = TypedDictExpr(info).set_line(call.line)
18301830
return info
1831-
1831+
18321832
def parse_typeddict_args(self, call: CallExpr,
18331833
fullname: str) -> Tuple[List[str], List[Type], bool]:
18341834
# TODO Share code with check_argument_count in checkexpr.py?
@@ -1848,7 +1848,7 @@ def parse_typeddict_args(self, call: CallExpr,
18481848
dictexpr = args[1]
18491849
items, types, ok = self.parse_typeddict_fields_with_types(dictexpr.items, call)
18501850
return items, types, ok
1851-
1851+
18521852
def parse_typeddict_fields_with_types(self, dict_items: List[Tuple[Expression, Expression]],
18531853
context: Context) -> Tuple[List[str], List[Type], bool]:
18541854
items = [] # type: List[str]
@@ -1864,12 +1864,12 @@ def parse_typeddict_fields_with_types(self, dict_items: List[Tuple[Expression, E
18641864
return self.fail_typeddict_arg('Invalid field type', field_type_expr)
18651865
types.append(self.anal_type(type))
18661866
return items, types, True
1867-
1867+
18681868
def fail_typeddict_arg(self, message: str,
18691869
context: Context) -> Tuple[List[str], List[Type], bool]:
18701870
self.fail(message, context)
18711871
return [], [], False
1872-
1872+
18731873
def build_typeddict_typeinfo(self, name: str, items: List[str],
18741874
types: List[Type]) -> TypeInfo:
18751875
strtype = self.named_type('__builtins__.str') # type: Type
@@ -1879,11 +1879,11 @@ def build_typeddict_typeinfo(self, name: str, items: List[str],
18791879

18801880
info = self.basic_new_typeinfo(name, fallback)
18811881
info.is_typed_dict = True
1882-
1882+
18831883
# (TODO: Store {items, types} inside "info" somewhere for use later.
18841884
# Probably inside a new "info.keys" field which
18851885
# would be analogous to "info.names".)
1886-
1886+
18871887
return info
18881888

18891889
def visit_decorator(self, dec: Decorator) -> None:

mypy/strconv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def visit_namedtuple_expr(self, o: 'mypy.nodes.NamedTupleExpr') -> str:
421421
return 'NamedTupleExpr:{}({}, {})'.format(o.line,
422422
o.info.name(),
423423
o.info.tuple_type)
424-
424+
425425
def visit_typeddict_expr(self, o: 'mypy.nodes.TypedDictExpr') -> str:
426426
return 'TypedDictExpr:{}({})'.format(o.line,
427427
o.info.name())

mypy/treetransform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def visit_newtype_expr(self, node: NewTypeExpr) -> NewTypeExpr:
490490

491491
def visit_namedtuple_expr(self, node: NamedTupleExpr) -> Node:
492492
return NamedTupleExpr(node.info)
493-
493+
494494
def visit_typeddict_expr(self, node: TypedDictExpr) -> Node:
495495
return TypedDictExpr(node.info)
496496

mypy/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]:
1616
"""
1717
def new_dict(*args, **kwargs):
1818
return dict(*args, **kwargs)
19-
19+
2020
new_dict.__name__ = typename # type: ignore # https://github.com/python/mypy/issues/708
2121
new_dict.__supertype__ = dict # type: ignore # https://github.com/python/mypy/issues/708
2222
return cast(Type[dict], new_dict)

mypy/visitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def visit_type_alias_expr(self, o: 'mypy.nodes.TypeAliasExpr') -> T:
224224

225225
def visit_namedtuple_expr(self, o: 'mypy.nodes.NamedTupleExpr') -> T:
226226
pass
227-
227+
228228
def visit_typeddict_expr(self, o: 'mypy.nodes.TypedDictExpr') -> T:
229229
pass
230230

0 commit comments

Comments
 (0)