Closed csala closed 5 years ago
Sometimes it would be useful to be able to call a static or class method, or even an unbound method, passing an instance as the first method.
An example would be pandas.DataFrame.dropna, which could be called as pandas.DataFrame.dropna(X).
pandas.DataFrame.dropna
pandas.DataFrame.dropna(X)
However, the current import_object implementation fails to support this, because it expects pandas.DataFrame to be a module.
import_object
pandas.DataFrame
To fix this, import_object should work recursively, trying to import the parent module if an import fails.
Sometimes it would be useful to be able to call a static or class method, or even an unbound method, passing an instance as the first method.
An example would be
pandas.DataFrame.dropna
, which could be called aspandas.DataFrame.dropna(X)
.However, the current
import_object
implementation fails to support this, because it expectspandas.DataFrame
to be a module.To fix this,
import_object
should work recursively, trying to import the parent module if an import fails.