i want to import some function in a class without needing to import the whole class.
I have some class as follows
MyClassFile.py
class MyClass: def __init__(self): pass #Some init stuff def some_funcs(self): pass #Some other funcs @staticmethod def desired_func(): pass #The func i want to import MyScript.py
from MyClassFile import MyClass.desired_func or
from MyClassFile.MyClass import desired_func I tried to import that way but isn't work, is there any way to do it?