I have a dataclass in extensions
> __init__.py
like:
@dataclass
class Range:
start: date
end: date
def overlap(self, other: Range) -> bool:
# method body removed
My IDE is complaining about the method parameter
Unresolved reference 'Range'
If I change the parameter type to
def overlap(self, other: extensions.Range) -> bool:
IDE stops complaining but when I run my program I get
partially initialized module 'extensions' has no attribute 'Range' (most likely due to a circular import)
I'm learning Typing in python and cannot figure out how to define this type in my method