Python Forum
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
colpage.py
#7
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.
Reply


Messages In This Thread
colpage.py - by Skaperen - Apr-29-2017, 06:12 AM
RE: colpage.py - by volcano63 - Apr-29-2017, 09:04 AM
RE: colpage.py - by nilamo - Apr-29-2017, 04:57 PM
RE: colpage.py - by Skaperen - Apr-30-2017, 02:41 AM
RE: colpage.py - by Skaperen - Apr-30-2017, 04:10 AM
RE: colpage.py - by nilamo - Apr-30-2017, 04:31 AM
RE: colpage.py - by Mekire - Apr-30-2017, 04:42 AM
RE: colpage.py - by Skaperen - Apr-30-2017, 05:24 AM
RE: colpage.py - by Skaperen - Apr-30-2017, 05:10 AM
RE: colpage.py - by Mekire - Apr-30-2017, 05:14 AM
RE: colpage.py - by Skaperen - Apr-30-2017, 05:36 AM
RE: colpage.py - by Mekire - Apr-30-2017, 05:28 AM
RE: colpage.py - by Skaperen - May-02-2017, 04:31 AM
RE: colpage.py - by Mekire - Apr-30-2017, 05:46 AM
RE: colpage.py - by Skaperen - Apr-30-2017, 06:15 AM
RE: colpage.py - by Mekire - Apr-30-2017, 07:17 AM
RE: colpage.py - by Skaperen - Apr-30-2017, 09:42 AM
RE: colpage.py - by volcano63 - May-01-2017, 05:00 PM
RE: colpage.py - by Mekire - May-01-2017, 10:39 PM
RE: colpage.py - by volcano63 - May-01-2017, 10:47 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020