Skip to content

Commit

Permalink
[minor] rename visitor method for better consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Aug 29, 2020
1 parent 5dd28ed commit 7b9a052
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3974,7 +3974,7 @@ def visit_temp_node(self, e: TempNode) -> Type:
def visit_type_var_expr(self, e: TypeVarExpr) -> Type:
return AnyType(TypeOfAny.special_form)

def visit_paramspec_var_expr(self, e: ParamSpecExpr) -> Type:
def visit_paramspec_expr(self, e: ParamSpecExpr) -> Type:
return AnyType(TypeOfAny.special_form)

def visit_newtype_expr(self, e: NewTypeExpr) -> Type:
Expand Down
2 changes: 1 addition & 1 deletion mypy/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def visit_backquote_expr(self, e: BackquoteExpr) -> None:
def visit_type_var_expr(self, e: TypeVarExpr) -> None:
return None

def visit_paramspec_var_expr(self, e: ParamSpecExpr) -> None:
def visit_paramspec_expr(self, e: ParamSpecExpr) -> None:
return None

def visit_type_alias_expr(self, e: TypeAliasExpr) -> None:
Expand Down
2 changes: 1 addition & 1 deletion mypy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,7 @@ def deserialize(cls, data: JsonDict) -> 'TypeVarExpr':

class ParamSpecExpr(TypeVarLikeExpr):
def accept(self, visitor: ExpressionVisitor[T]) -> T:
return visitor.visit_paramspec_var_expr(self)
return visitor.visit_paramspec_expr(self)

def serialize(self) -> JsonDict:
return {
Expand Down
2 changes: 1 addition & 1 deletion mypy/strconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def visit_type_var_expr(self, o: 'mypy.nodes.TypeVarExpr') -> str:
a += ['UpperBound({})'.format(o.upper_bound)]
return self.dump(a, o)

def visit_paramspec_var_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> str:
def visit_paramspec_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> str:
import mypy.types
a = [] # type: List[Any]
if o.variance == mypy.nodes.COVARIANT:
Expand Down
2 changes: 1 addition & 1 deletion mypy/treetransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def visit_type_var_expr(self, node: TypeVarExpr) -> TypeVarExpr:
self.types(node.values),
self.type(node.upper_bound), variance=node.variance)

def visit_paramspec_var_expr(self, node: ParamSpecExpr) -> ParamSpecExpr:
def visit_paramspec_expr(self, node: ParamSpecExpr) -> ParamSpecExpr:
return ParamSpecExpr(
node.name, node.fullname, self.type(node.upper_bound), variance=node.variance
)
Expand Down
4 changes: 2 additions & 2 deletions mypy/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def visit_type_var_expr(self, o: 'mypy.nodes.TypeVarExpr') -> T:
pass

@abstractmethod
def visit_paramspec_var_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> T:
def visit_paramspec_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> T:
pass

@abstractmethod
Expand Down Expand Up @@ -533,7 +533,7 @@ def visit_backquote_expr(self, o: 'mypy.nodes.BackquoteExpr') -> T:
def visit_type_var_expr(self, o: 'mypy.nodes.TypeVarExpr') -> T:
pass

def visit_paramspec_var_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> T:
def visit_paramspec_expr(self, o: 'mypy.nodes.ParamSpecExpr') -> T:
pass

def visit_type_alias_expr(self, o: 'mypy.nodes.TypeAliasExpr') -> T:
Expand Down
2 changes: 1 addition & 1 deletion mypyc/irbuild/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def visit_type_application(self, o: TypeApplication) -> Value:
def visit_type_var_expr(self, o: TypeVarExpr) -> Value:
assert False, "can't compile analysis-only expressions"

def visit_paramspec_var_expr(self, o: ParamSpecExpr) -> Value:
def visit_paramspec_expr(self, o: ParamSpecExpr) -> Value:
assert False, "can't compile analysis-only expressions"

def visit_typeddict_expr(self, o: TypedDictExpr) -> Value:
Expand Down

0 comments on commit 7b9a052

Please sign in to comment.