File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ def _ast_node_for(string: str) -> ast.AST:
145145 assert isinstance (expr , ast .Expr )
146146 return expr .value
147147
148+
148149def _flatten_name (node : ast .expr ) -> str | None :
149150 """Return the flattened name of an expression, or None.
150151
@@ -160,6 +161,7 @@ def _flatten_name(node: ast.expr) -> str | None:
160161 return f"{ parent } .{ node .attr } " if parent else None
161162 return None
162163
164+
163165def _is_name (node : ast .AST | None , name : str ) -> bool :
164166 """Return True if `node` is an `ast.Name` node with id `name`.
165167
@@ -2046,7 +2048,11 @@ def check_protocol_param_kinds(
20462048 pos_or_kw , errors .Y091 .format (arg = pos_or_kw .arg , method = node .name )
20472049 )
20482050
2049- def check_for_override (self , node : ast .FunctionDef | ast .AsyncFunctionDef , decorator_names : Container [str ]) -> None :
2051+ def check_for_override (
2052+ self ,
2053+ node : ast .FunctionDef | ast .AsyncFunctionDef ,
2054+ decorator_names : Container [str ],
2055+ ) -> None :
20502056 if "override" in decorator_names or "typing.override" in decorator_names :
20512057 self .error (node , errors .Y068 )
20522058
Original file line number Diff line number Diff line change 11import typing
22import typing as t
3- from typing import override
4- from typing import override as over
3+ from typing import override , override as over
54
65class Foo :
76 def f (self ) -> None : ...
You can’t perform that action at this time.
0 commit comments