[TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

88888 Dihedral dihedral88888 at googlemail.com
Sat Apr 20 03:50:52 EDT 2013


Ned Batchelder於 2013年4月20日星期六UTC+8上午12時41分03秒寫道:
> On 4/19/2013 12:16 PM, Steven D'Aprano wrote:
> 
> > On Fri, 19 Apr 2013 12:02:00 -0400, Roy Smith wrote:
> 
> >
> 
> >> 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.
> 
> > I'm not a C++ expert, but I am an inquiring mind, and I want to know the
> 
> > answer!
> 
> >
> 
> >
> 
> The only difference between a class and a struct is that classes default 
> 
> to "private" access for their members, and structs default to "public".
> 
> 
> 
> --Ned.
In python even a class can be decorated. Also features of instances
can be added at run time from programs by different programmers
or even programs from machines by the code generation scheme
used in many CAD tools.

Nowadays the concept of a structure is not clear without
specifying the language used in programming.

A list is a structure of non-homogeneous types of items  in LISP,
PERL and PYTHON.

But the cases are different in C++, PASCAL, ADDA, JAVA ....



More information about the Python-list mailing list