News for hackers. Stuff that matters.
Re:Things to use in Python 3 by bitcurious on Wednesday May 15, 2019 @10:15AM (#19919571)
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.

Re:Things to use in Python 3 by jimbo1qaz on Wednesday May 15, 2019 @10:49AM (#19919920)
from typing import TYPE_CHECKING

if TYPE_CHECKING:

  import whatever
def foo(param: 'whatever'): ...
Re:Things to use in Python 3 by bitcurious on Thursday May 16, 2019 @03:19PM (#19932122)
Thanks! :)