On Wed, Jan 14, 2009 at 4:35 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "James Mills" <prolo...@shortcircuit.net.au> writes: >> Bare in mind also, that enfocing access control / policing as you >> called it has a performance hit as the machine (the Python vm) >> has to perform checks each time members of an object are accessed. > > It's the other way around. If the compiler knows that you aren't > creating new attributes on the fly, it can put them into fixed slots > like a C struct, and method calls become ordinary function calls > through a dispatch vector.
Paul I wasn't referring to static languages and languages that are compiled to machine code such as C, C++, etc. Python is a dynamic object oriented language ... (almost verbatim from the website). It is compiled to bytecode and run on a virtual machine. I don't really think it would be possible or desirable to have strict access control (encapsulation) in the core of python. a) it would piss us all off. b) it would greatly impact on the dynamic nature of python. cheers James -- http://mail.python.org/mailman/listinfo/python-list