Skip to content

Commit 4d2674f

Browse files
committed
Fix some indentation errors
1 parent 2718ca9 commit 4d2674f

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

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

mypy/checker.py

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

44574457
if isinstance(tp, Instance):
4458-
if tp.type.fullname in ['builtins.list', 'builtins.tuple', 'builtins.dict',
4459-
'builtins.set', 'builtins.frozenset']:
4458+
if tp.type.fullname in [
4459+
'builtins.list', 'builtins.tuple', 'builtins.dict',
4460+
'builtins.set', 'builtins.frozenset',
4461+
]:
44604462
if not tp.args:
44614463
# TODO: fix tuple in lib-stub/builtins.pyi (it should be generic).
44624464
return None

mypy/messages.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,7 @@ def format(typ: Type) -> str:
14181418
if isinstance(typ, Instance):
14191419
itype = typ
14201420
# Get the short name of the type.
1421-
if itype.type.fullname in ('types.ModuleType',
1422-
'_importlib_modulespec.ModuleType'):
1421+
if itype.type.fullname in ('types.ModuleType', '_importlib_modulespec.ModuleType'):
14231422
# Make some common error messages simpler and tidier.
14241423
return 'Module'
14251424
if verbosity >= 2 or (fullnames and itype.type.fullname in fullnames):

mypy/semanal.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,7 @@ class Foo(Bar, Generic[T]): ...
12411241
if isinstance(base, UnboundType):
12421242
sym = self.lookup_qualified(base.name, base)
12431243
if sym is not None and sym.node is not None:
1244-
if (sym.node.fullname in ('typing.Protocol',
1245-
'typing_extensions.Protocol') and
1244+
if (sym.node.fullname in ('typing.Protocol', 'typing_extensions.Protocol') and
12461245
i not in removed):
12471246
# also remove bare 'Protocol' bases
12481247
removed.append(i)
@@ -3071,8 +3070,7 @@ def is_final_type(self, typ: Optional[Type]) -> bool:
30713070
sym = self.lookup_qualified(typ.name, typ)
30723071
if not sym or not sym.node:
30733072
return False
3074-
return sym.node.fullname in ('typing.Final',
3075-
'typing_extensions.Final')
3073+
return sym.node.fullname in ('typing.Final', 'typing_extensions.Final')
30763074

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

0 commit comments

Comments
 (0)