Annotations#
register_annotations#
- tkclasswiz.annotations.register_annotations(cls: type, mapping: dict | None = {}, **annotations)#
Extends original annotations of
cls.This can be useful eg. when the class your are adding is not part of your code and is also not annotated.
Classes that already have additional annotations:
datetime.timedelta
datetime.datetime
datetime.timezone
- Parameters:
Example
from datetime import timedelta, timezone register_annotations( timezone, offset=timedelta, name=str )