On Wed, Feb 22, 2017 at 10:49 PM, Zachary Ware
<[email protected]> wrote:
> On Wed, Feb 22, 2017 at 10:25 PM, boB Stepp <[email protected]> wrote:
>
> I'll give you a couple of hints. First, try this:
>
> print('defining A')
> class A:
> print('Setting a on class A')
When I typed this in I was surprised to find that the print() happens
without having created an instance of this class yet. Further
experimentation seems to indicate that all class methods and
attributes get executed and assigned when the class definition is
first read into the interpreter without any need to create an instance
of the class. This is good to know!
> Next, have a look at
> https://docs.python.org/3/library/functions.html#super and in
> particular the link at the end to Raymond Hettinger's "super
> considered super" essay.
I had actually bookmarked this last week in my browser for later
reading. I just got finished reading it. It has brought additional
clarity, but also much more I need to think about and explore.
Thanks, Zach!
--
boB
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor