Skip to content

Commit

Permalink
fix(utility): init "_attrs_fields" in "AttrsMixin.__init_subclass__"
Browse files Browse the repository at this point in the history
PR Closed: #559
  • Loading branch information
zhen.chen authored and AChenQ committed May 18, 2021
1 parent 1e02aa6 commit dbb5494
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tensorbay/utility/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ class AttrsMixin:
"""

_attrs_fields: Dict[str, Field] = {}
_attrs_supports: Set[Any] = set()
_attrs_fields: Dict[str, Field]
_attrs_supports: Set[Any]

def __init_subclass__(cls) -> None:
for name, type_ in getattr(cls, "__annotations__", {}).items():
cls._attrs_fields = {}
field = _get_field(cls, name, type_)
if field:
cls._attrs_fields[name] = field
Expand Down

0 comments on commit dbb5494

Please sign in to comment.