I have a simple function that I will call myFunction . It takes two parameters, performs some calculations on them and returns the result.
I also have a MyClass class that has a constructor with the following title:
__init__(self, bar, fun=myFunction):
When I try to run something in this class, I get the following error:
MyClass def __init__(self, bar, fun=myFunction): NameError: name 'myFunction' is not defined
If I remove this class, I can use myFun in the Python Shell, so what's the deal?
source share