Skip to content

Commit d41de47

Browse files
author
hauntsaninja
committed
more tvdef -> tv
1 parent 591bcef commit d41de47

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

mypy/checkexpr.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3277,15 +3277,15 @@ def check_lst_expr(self, items: List[Expression], fullname: str,
32773277
# Used for list and set expressions, as well as for tuples
32783278
# containing star expressions that don't refer to a
32793279
# Tuple. (Note: "lst" stands for list-set-tuple. :-)
3280-
tvdef = TypeVarType('T', 'T', -1, [], self.object_type())
3280+
tv = TypeVarType('T', 'T', -1, [], self.object_type())
32813281
constructor = CallableType(
3282-
[tvdef],
3282+
[tv],
32833283
[nodes.ARG_STAR],
32843284
[None],
3285-
self.chk.named_generic_type(fullname, [tvdef]),
3285+
self.chk.named_generic_type(fullname, [tv]),
32863286
self.named_type('builtins.function'),
32873287
name=tag,
3288-
variables=[tvdef])
3288+
variables=[tv])
32893289
out = self.check_call(constructor,
32903290
[(i.expr if isinstance(i, StarExpr) else i)
32913291
for i in items],
@@ -3434,22 +3434,22 @@ def visit_dict_expr(self, e: DictExpr) -> Type:
34343434
tup.column = value.column
34353435
args.append(tup)
34363436
# Define type variables (used in constructors below).
3437-
ktdef = TypeVarType('KT', 'KT', -1, [], self.object_type())
3438-
vtdef = TypeVarType('VT', 'VT', -2, [], self.object_type())
3437+
kt = TypeVarType('KT', 'KT', -1, [], self.object_type())
3438+
vt = TypeVarType('VT', 'VT', -2, [], self.object_type())
34393439
rv = None
34403440
# Call dict(*args), unless it's empty and stargs is not.
34413441
if args or not stargs:
34423442
# The callable type represents a function like this:
34433443
#
34443444
# def <unnamed>(*v: Tuple[kt, vt]) -> Dict[kt, vt]: ...
34453445
constructor = CallableType(
3446-
[TupleType([ktdef, vtdef], self.named_type('builtins.tuple'))],
3446+
[TupleType([kt, vt], self.named_type('builtins.tuple'))],
34473447
[nodes.ARG_STAR],
34483448
[None],
3449-
self.chk.named_generic_type('builtins.dict', [ktdef, vtdef]),
3449+
self.chk.named_generic_type('builtins.dict', [kt, vt]),
34503450
self.named_type('builtins.function'),
34513451
name='<dict>',
3452-
variables=[ktdef, vtdef])
3452+
variables=[kt, vt])
34533453
rv = self.check_call(constructor, args, [nodes.ARG_POS] * len(args), e)[0]
34543454
else:
34553455
# dict(...) will be called below.
@@ -3460,13 +3460,13 @@ def visit_dict_expr(self, e: DictExpr) -> Type:
34603460
for arg in stargs:
34613461
if rv is None:
34623462
constructor = CallableType(
3463-
[self.chk.named_generic_type('typing.Mapping', [ktdef, vtdef])],
3463+
[self.chk.named_generic_type('typing.Mapping', [kt, vt])],
34643464
[nodes.ARG_POS],
34653465
[None],
3466-
self.chk.named_generic_type('builtins.dict', [ktdef, vtdef]),
3466+
self.chk.named_generic_type('builtins.dict', [kt, vt]),
34673467
self.named_type('builtins.function'),
34683468
name='<list>',
3469-
variables=[ktdef, vtdef])
3469+
variables=[kt, vt])
34703470
rv = self.check_call(constructor, [arg], [nodes.ARG_POS], arg)[0]
34713471
else:
34723472
self.check_method_call_by_name('update', rv, [arg], [nodes.ARG_POS], arg)
@@ -3756,16 +3756,16 @@ def check_generator_or_comprehension(self, gen: GeneratorExpr,
37563756

37573757
# Infer the type of the list comprehension by using a synthetic generic
37583758
# callable type.
3759-
tvdef = TypeVarType('T', 'T', -1, [], self.object_type())
3760-
tv_list: List[Type] = [tvdef]
3759+
tv = TypeVarType('T', 'T', -1, [], self.object_type())
3760+
tv_list: List[Type] = [tv]
37613761
constructor = CallableType(
37623762
tv_list,
37633763
[nodes.ARG_POS],
37643764
[None],
37653765
self.chk.named_generic_type(type_name, tv_list + additional_args),
37663766
self.chk.named_type('builtins.function'),
37673767
name=id_for_messages,
3768-
variables=[tvdef])
3768+
variables=[tv])
37693769
return self.check_call(constructor,
37703770
[gen.left_expr], [nodes.ARG_POS], gen)[0]
37713771

0 commit comments

Comments
 (0)