Suppose I have a file with a bunch methods as bunch_methods.py:
def one(x): return int(x) def two(y) return str(y)
Is there a way to take th
I don't know why you would want this, as you can already use the module as a class, but anyway:
import bunch_methods as bm print bm.one('1') print bm.two(1) class BunchClass: def __init__(self, methods): self.__dict__.update(methods.__dict__) bc = BunchClass(bm) print bc.one('2') print bc.two(2)