Skip to content

Commit 7ee08ee

Browse files
committed
Fix some indentation errors
1 parent ac82d25 commit 7ee08ee

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

Diff for: misc/proper_plugin.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,24 @@ def is_special_target(right: ProperType) -> bool:
5151
if right.type_object().fullname == 'builtins.tuple':
5252
# Used with Union[Type, Tuple[Type, ...]].
5353
return True
54-
if right.type_object().fullname in ('mypy.types.Type',
55-
'mypy.types.ProperType',
56-
'mypy.types.TypeAliasType'):
54+
if right.type_object().fullname in (
55+
'mypy.types.Type',
56+
'mypy.types.ProperType',
57+
'mypy.types.TypeAliasType'
58+
):
5759
# Special case: things like assert isinstance(typ, ProperType) are always OK.
5860
return True
59-
if right.type_object().fullname in ('mypy.types.UnboundType',
60-
'mypy.types.TypeVarType',
61-
'mypy.types.RawExpressionType',
62-
'mypy.types.EllipsisType',
63-
'mypy.types.StarType',
64-
'mypy.types.TypeList',
65-
'mypy.types.CallableArgument',
66-
'mypy.types.PartialType',
67-
'mypy.types.ErasedType'):
61+
if right.type_object().fullname in (
62+
'mypy.types.UnboundType',
63+
'mypy.types.TypeVarType',
64+
'mypy.types.RawExpressionType',
65+
'mypy.types.EllipsisType',
66+
'mypy.types.StarType',
67+
'mypy.types.TypeList',
68+
'mypy.types.CallableArgument',
69+
'mypy.types.PartialType',
70+
'mypy.types.ErasedType'
71+
):
6872
# Special case: these are not valid targets for a type alias and thus safe.
6973
# TODO: introduce a SyntheticType base to simplify this?
7074
return True

Diff for: mypy/checker.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -4269,8 +4269,10 @@ def builtin_item_type(tp: Type) -> Optional[Type]:
42694269
tp = get_proper_type(tp)
42704270

42714271
if isinstance(tp, Instance):
4272-
if tp.type.fullname in ['builtins.list', 'builtins.tuple', 'builtins.dict',
4273-
'builtins.set', 'builtins.frozenset']:
4272+
if tp.type.fullname in [
4273+
'builtins.list', 'builtins.tuple', 'builtins.dict',
4274+
'builtins.set', 'builtins.frozenset',
4275+
]:
42744276
if not tp.args:
42754277
# TODO: fix tuple in lib-stub/builtins.pyi (it should be generic).
42764278
return None

Diff for: mypy/messages.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1403,8 +1403,7 @@ def format(typ: Type) -> str:
14031403
if isinstance(typ, Instance):
14041404
itype = typ
14051405
# Get the short name of the type.
1406-
if itype.type.fullname in ('types.ModuleType',
1407-
'_importlib_modulespec.ModuleType'):
1406+
if itype.type.fullname in ('types.ModuleType', '_importlib_modulespec.ModuleType'):
14081407
# Make some common error messages simpler and tidier.
14091408
return 'Module'
14101409
if verbosity >= 2 or (fullnames and itype.type.fullname in fullnames):

Diff for: mypy/semanal.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1236,8 +1236,7 @@ class Foo(Bar, Generic[T]): ...
12361236
if isinstance(base, UnboundType):
12371237
sym = self.lookup_qualified(base.name, base)
12381238
if sym is not None and sym.node is not None:
1239-
if (sym.node.fullname in ('typing.Protocol',
1240-
'typing_extensions.Protocol') and
1239+
if (sym.node.fullname in ('typing.Protocol', 'typing_extensions.Protocol') and
12411240
i not in removed):
12421241
# also remove bare 'Protocol' bases
12431242
removed.append(i)
@@ -3066,8 +3065,7 @@ def is_final_type(self, typ: Optional[Type]) -> bool:
30663065
sym = self.lookup_qualified(typ.name, typ)
30673066
if not sym or not sym.node:
30683067
return False
3069-
return sym.node.fullname in ('typing.Final',
3070-
'typing_extensions.Final')
3068+
return sym.node.fullname in ('typing.Final', 'typing_extensions.Final')
30713069

30723070
def fail_invalid_classvar(self, context: Context) -> None:
30733071
self.fail('ClassVar can only be used for assignments in class body', context)

0 commit comments

Comments
 (0)