Apr-30-2017, 04:42 AM
Quote:It's just weird, not wrong.Honestly, I would say despite not being wrong, it is still quite wrong.
__init__ can only return None and by convention we never do this explicitly for __init__.
The function is "wrong" because just like this thread shows, it confuses people.
Just write this and avoid confusion:
class colpage: def __init__(self, gutter=None, width=None, height=None): self.geometry( gutter=gutter, width=width, height=height)Though I think changes should still be made to make attributes clearer and there is no need to use that function to both set and get these attributes. As a C programmer I would think you would hate a function with an unpredictable return type.