9
When to use typing.TYPE_CHECKING
(feddit.de)
Welcome to the Python community on the programming.dev Lemmy instance!
October 2023
November 2023
Past
July 2023
August 2023
September 2023
That's a very cool feature, had no clue about it!
If it doesn't have any visible downsides, it's be nice use it whenever possible. This should provide the additional benefit of having the imports clearly separated.
The tediousness aspect of it makes me wonder though. I'd probably just only use it when I'm specifically importing something only for typing .
Maybe could be a cool feature request for an lsp as well.