PyLint told me that one of my class methods didn't need to be a method, but could just be a function in a class since it didn't use any class attribute. That made me do things I thought were "bad," but maybe they are Pythonic. Is the following code what Python wants us to do?
class TestClass(ParentClass):
def __init__(self):
def callbackfunction(text):
print("hello")
ParentClass.map_event_to_callback(ParentClass.event, callbackfunction)
where ParentClass.event emits text to its callback, but we'll just ignore that print "hello" instead. Even simpler:
class TestClass():
def __init__(self, text):
def printhello(text):
print("hello")
printhello(text)
assuming I don't care about text or printhello after __init__.
lambdatoo.__init__made me feel dirty, but I didn't know if there was a technical reason to avoid it or not. @MartijnPieters, if you make your comment an answer I can select it.