Skip to content

Commit

Permalink
Allow required types in objects using type hint comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
dangle committed Nov 20, 2017
1 parent 254d73f commit af34e4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion typet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@ def __new__(cls, name, bases, attrs):
names, attrs, annotations, attr)]
typed_attrs['_tp__typed_properties'] = properties
typed_attrs['_tp__undefined_typed_properties'] = [
attr for attr in properties if attr not in attrs]
attr for attr in properties if attr not in attrs or
attrs[attr] is None and use_comment_type_hints]
return super(_AnnotatedObjectMeta, cls).__new__(
cls, name, bases, typed_attrs)

Expand Down

0 comments on commit af34e4e

Please sign in to comment.