Skip to content

Commit

Permalink
Fix typing to 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
v.kuvaitsev committed Mar 21, 2024
1 parent 157a560 commit 286bc46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions flake8_class_attributes_order/model_parts_info.py
@@ -1,5 +1,5 @@
import ast
from typing import Mapping
from typing import Mapping, Set, Dict, Union


def get_model_parts_info(model_ast, weights: Mapping[str, int]):
Expand Down Expand Up @@ -82,8 +82,8 @@ def get_funcdef_type(child_node) -> str:

def get_funcdef_type_by_decorator_info( # noqa: CFQ004
node,
decorator_names_to_types_map: dict[str, str],
) -> str | None:
decorator_names_to_types_map: Dict[str, str],
) -> Union[str, None]:
for decorator_info in node.decorator_list:
if (
isinstance(decorator_info, ast.Name)
Expand All @@ -99,7 +99,7 @@ def get_funcdef_type_by_decorator_info( # noqa: CFQ004

def get_funcdef_type_by_node_name( # noqa: CFQ004
node,
special_methods_names: set[str],
special_methods_names: Set[str],
default_type: str = 'method',
) -> str:
if node.name in special_methods_names:
Expand Down
4 changes: 2 additions & 2 deletions flake8_class_attributes_order/node_type_weights.py
Expand Up @@ -4,7 +4,7 @@
from typing_extensions import Final


NON_STRICT_NODE_TYPE_WEIGHTS: Final[dict[str, int]] = {
NON_STRICT_NODE_TYPE_WEIGHTS: Final[Dict[str, int]] = {
'docstring': 0,
'pass': 1,
'meta_class': 2,
Expand Down Expand Up @@ -40,7 +40,7 @@
'private_method': 27,
}

STRICT_NODE_TYPE_WEIGHTS: Final[dict[str, int]] = {
STRICT_NODE_TYPE_WEIGHTS: Final[Dict[str, int]] = {
'docstring': 0,
'pass': 1,
'meta_class': 2,
Expand Down

0 comments on commit 286bc46

Please sign in to comment.