On Thu, 27 Oct 2011 16:01:25 +0200, candide wrote:

> OK, thanks for the information abouts the slots. Nevertheless, this
> cannot answer completely my question. Some builtin types like string,
> lists, integer, float, dictionaries, etc have the property that
> instances of those types don't provide a __dict__ attribute. I can't
> imagine the documentation lets pass silently this point.

What, you think it goes against the laws of physics that nobody thought 
to mention it in the docs? <wink>

> But beside this, how to recognise classes whose object doesn't have a
> __dict__ attribute ?

The same way as you would test for any other attribute.

>>> hasattr(42, '__dict__')
False


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to