Instance of class "object"

Peter Otten __peter__ at web.de
Fri May 16 05:26:55 EDT 2008


甜瓜 wrote:

>     I wonder why below does not work.
> 
> a = object()
> a.b = 1        # dynamic bind attribute failed...

The implementation of slots depends on that behaviour:

http://docs.python.org/ref/slots.html

> Does this strange behavior break the LSP (Liskov substitution principle)?

Can you expand on that?

Peter



More information about the Python-list mailing list