Reputation: 1169
If so, how would you do this.
def methodname(self, blah, blah) ^how do I place a function inside this.
Upvotes: 0
Views: 89
Reputation: 179392
Yes, you just stick a def
inside. You can even nest whole classes inside functions and methods:
class Foo(object):
def method(self, bar):
def inner(magic):
class Madness(object):
def __init__(inself, foo): inself.foo = foo
return Madness(magic)
return inner(bar)
Upvotes: 4