Skip to content

Commit

Permalink
Handle single type for 3.9 annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph committed Jul 18, 2023
1 parent 26c19aa commit f8566c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tickit/utils/configuration/configurable.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init_subclass__(cls) -> None:
# Add a discriminator field to the class so it can
# be identified when deserializing.
cls.__annotations__ = {
**cls.__annotations__,
**getattr(cls, "__annotations__", {}),
discriminator: Literal[cls_name],
}
setattr(cls, discriminator, field(default=cls_name, repr=False))
Expand Down

0 comments on commit f8566c7

Please sign in to comment.