3 ms·
What's the best practice for type hinting a class that's not being imported? I.e. A module contains a function that accepts a pandas.DataFrame. This module doe
by bitcurious 7y ago
What's the best practice for type hinting a class that's not being imported?
I.e. A module contains a function that accepts a pandas.DataFrame. This module doesn't import pandas.
- jimbo1qaz 7y agofrom typing import TYPE_CHECKING if TYPE_CHECKING: import whatever def foo(param: 'whatever'): ...
- bitcurious 7y agoThanks! :)