>> >> Summary questions: >> >> 1 - Why are foo's and bar's class sizes the same? (foo's just a nop) > > > i'm not sure on this one. > >> 2 - Why are foo() and bar() the same size, even with bar()'s 4 integers? > > > neither foo() nor bar() return anything explicitly, so both return the > default none
This needs correction. I think you're thinking of regular functions. But 'foo' and 'bar' are the names of the classes, so this is instance construction. To demonstrate the difference: ##################################### >>> class foo(object): pass ... >>> foo() <__main__.foo object at 0x7f27655c0fd0> ##################################### Compare what we see here to: ###################################### >>> def bar(): pass ... >>> bar() >>> ###################################### where the interactive evaluator is suppressing output of the None value. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor