Following PEP 526 I'm wondering how to properly type hint an instance or class attribute that is decorated by a property. Do I type hint the underlying attribute or the name or the property?
Example of typing the attribute:
class Sample(object):
_target_dir: Path
@property
def target_dir(self):
pass
Or typing the property:
class Sample(object):
target_dir: Path
Or some other way? Is it the same for instance and class variables?