Skip to content

Commit

Permalink
fix(utility): init "_attrs_fields" outside the loop in "AttrsMixin"
Browse files Browse the repository at this point in the history
PR Closed: #560
  • Loading branch information
zhen.chen authored and AChenQ committed May 18, 2021
1 parent dbb5494 commit d33a810
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorbay/utility/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class AttrsMixin:
_attrs_supports: Set[Any]

def __init_subclass__(cls) -> None:
cls._attrs_fields = {}
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 d33a810

Please sign in to comment.