-->

Defining same slot in base and derived python clas

2019-05-22 20:49发布

问题:

The docs say:

If a class defines a slot also defined in a base class, the instance variable defined by the base class slot is inaccessible (except by retrieving its descriptor directly from the base class). This renders the meaning of the program undefined. In the future, a check may be added to prevent this.

How is the undefined behavior introduced ? What would be an example ? How does the instance look like - does it have both attributes somehow ?