Regarding __slots__ and other stuff: A couple of questions

dave berk dave.brk at gmail.com
Thu Mar 27 16:09:45 EDT 2008


Didn't see your answer, Gabriel. Thanks, now I understand it even better.

On 3/27/08, dave berk <dave.brk at gmail.com> wrote:
>
> sorry, forget all I wrote: I should have read this more thoroughly, it
> explained it all
>
> http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.htm
>
>
> <http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html>Descriptors
> only works with type objects, not instance. and you can't write from an
> instance object to a
> class variable. You can only hide it. Also __slots__ works by creating descriptors in the class and preventing creation of any atrributes in the class instance, so everything is clear now
>
> Dave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080327/a6c5935d/attachment-0001.html>


More information about the Python-list mailing list