1212
1313"""
1414
15- from typing import Any , Dict , Iterable , Tuple , Type
15+ from collections . abc import Iterable
1616
1717from odin import registration
1818from odin .fields import BaseField
3535)
3636
3737
38- def _iterate_attrs (attrs : Dict [str , Any ]) -> Iterable [Tuple [str , BaseField ]]:
38+ def _iterate_attrs (attrs : dict [str , ... ]) -> Iterable [tuple [str , BaseField ]]:
3939 """Iterate through attributes and combine with annotations."""
40+
4041 annotations = attrs .pop ("__annotations__" , None ) or {}
4142
4243 # Yield any annotations processed into field instances
@@ -56,7 +57,7 @@ def __new__(
5657 name : str ,
5758 bases ,
5859 attrs : dict ,
59- meta_options_type : Type [MOT ] = ResourceOptions ,
60+ meta_options_type : type [MOT ] = ResourceOptions ,
6061 abstract : bool = False ,
6162 ):
6263 super_new = super ().__new__
@@ -92,8 +93,8 @@ def __new__(
9293 return r
9394
9495 # Add all field attributes to the class.
95- for name , field in _iterate_attrs (attrs ):
96- new_class .add_to_class (name , field )
96+ for field_name , field in _iterate_attrs (attrs ):
97+ new_class .add_to_class (field_name , field )
9798
9899 _add_parent_fields_to_class (new_class , new_meta , parents )
99100
0 commit comments