Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions pyoaev/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
import pprint
import textwrap
from types import ModuleType
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Type, Union
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterable,
Optional,
Type,
Union,
get_type_hints,
)

from pyoaev.exceptions import OpenAEVParsingError

Expand Down Expand Up @@ -157,7 +166,8 @@ def _create_managers(self) -> None:
# NOTE(jlvillal): We are creating our managers by looking at the class
# annotations. If an attribute is annotated as being a *Manager type
# then we create the manager and assign it to the attribute.
for attr, annotation in sorted(self.__annotations__.items()):
annotations = get_type_hints(type(self))
for attr, annotation in sorted(annotations.items()):
Comment on lines +169 to +170
# We ignore creating a manager for the 'manager' attribute as that
# is done in the self.__init__() method
if attr in ("manager",):
Expand Down
Loading