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

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Thu Jan 15 00:08:07 CET 2009


On Wed, 14 Jan 2009 08:45:46 -0800, Paul Rubin wrote:

>> Btw, for performance, there is __slots__,
> 
> That is a good point, we somehow lost sight of that in this thread.
> 
>> with the side-effect that it forbids attribute creation 'on the fly'.
> 
> I have had the impression that this is a somewhat accidental side effect
> and shouldn't be relied on.

Not accidental, but people complain if you use slots for the purpose of 
prohibiting attribute creation. They say "That's not what __slots__ was 
designed for!". That's okay though, computers were designed for breaking 
Germany ciphers and calculating the trajectory of cannon-shells, but 
they're not the only things we use computers for these days.



-- 
Steven



More information about the Python-list mailing list