Does Python really follow its philosophy of "Readability counts"?

James Mills prologic at shortcircuit.net.au
Wed Jan 14 01:55:34 EST 2009


On Wed, Jan 14, 2009 at 4:35 PM, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
> "James Mills" <prologic at 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



More information about the Python-list mailing list