Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
typing [2017/09/27 18:44] christian [Typed Attributes] |
typing [2017/09/27 18:45] christian [Typed Attributes] |
||
---|---|---|---|
Line 45: | Line 45: | ||
</ | </ | ||
This declares that the attribute #Contents of a Page can hold either | This declares that the attribute #Contents of a Page can hold either | ||
- | - a Contents object or | + | * a Contents object or |
- | - an array of Contents objects. | + | |
A type of an object is used when it gets assigned to an attribute. With the type requirement of the attribute, the object is specialized to the attribute type if possible. If this is not possible, a TypeError is raised. | A type of an object is used when it gets assigned to an attribute. With the type requirement of the attribute, the object is specialized to the attribute type if possible. If this is not possible, a TypeError is raised. |