next up previous contents index
Next: Function Types Up: More About Types in Previous: Union Types   Contents   Index


The Empty Type

NIL type the result type of

The type nil is also called the empty type, since no object is of type nil. The union of no types, (or), is also empty. Python's interpretation of an expression whose type is nil is that the expression never yields any value, but rather fails to terminate, or is thrown out of. For example, the type of a call toerror or a use of return is nil. When the type of an expression is empty, compile-time type warnings about its value are suppressed; presumably somebody else is signaling an error. If a function is declared to have return type nil, but does in fact return, then (in safe compilation policies) a ``NIL Function returned'' error will be signaled. See also the function (page [*])required-argument.



Peter Van Eynde 2000-02-08