[TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages
Roy Smith
roy at panix.com
Fri Apr 19 19:40:22 EDT 2013
In article <mailman.843.1366412626.3114.python-list at python.org>,
Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> On Fri, 19 Apr 2013 12:02:00 -0400, Roy Smith <roy at panix.com> declaimed
> the following in gmane.comp.python.general:
>
> > PS: a great C++ interview question is, "What's the difference between a
> > class and a struct?" Amazing how few self-professed C++ experts have no
> > clue.
>
> It's been 15+ years but...
>
> "class" defaults to private; " struct" defaults to public... (very
> simplified <G>)
You were doing well until you added the "very simplified" part :-) That
is indeed the only difference.
Many people are surprised that you can write member functions for
structs. Or that you can subclass (substruct?) them.
More information about the Python-list
mailing list