Do you have any general guidance on type hinting class instance types that would:
Is this the way to go? docs.python.org/3/library/typing.h...
Yes, if TYPE_CHECKING is the way to go. Note that if False also works, if you want to completely avoid importing the typing module.
if TYPE_CHECKING
if False
typing
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Do you have any general guidance on type hinting class instance types that would:
Is this the way to go?
docs.python.org/3/library/typing.h...
Yes,
if TYPE_CHECKINGis the way to go. Note thatif Falsealso works, if you want to completely avoid importing thetypingmodule.