Talk:Python (programming language): Difference between revisions

Content deleted Content added
Inheritance
object system answer
Line 48:
==Inheritance==
From what I read, Python has inheritance but no access control (public, private,...). Can someone ellaborate on OOP in Python? -- [[User:Error|Error]]
 
:Python has inheritance, including multiple inheritance. It has ''limited'' support for private variables using name mangling. See [http://www.python.org/doc/current/tut/node11.html#SECTION0011600000000000000000 the "Classes" section of the tutorial] for details.
 
:From the tutorial: ''As is true for modules, classes in Python do not put an absolute barrier between definition and user, but rather rely on the politeness of the user not to "break into the definition."''
 
:OOP doctrines such as the use of accessor methods to read data members are not enforced in Python. Just as Python offers [[functional programming]] constructs but does not attempt to demand referential transparency (contra [[Scheme programming language|Scheme]]), it offers (and extensively uses!) its object system but does not demand OOP behavior (contra [[Java programming language|Java]]). --[[User:Fubar Obfusco|FOo]] 04:58, 2 Sep 2003 (UTC)