next up previous contents
Next: 5.2.6 Function Types Up: 5.2 More About Types Previous: 5.2.4 Union Types

5.2.5 The Empty Type

       

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 to error 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 signalling 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 signalled. See also the function  required-argument (page gif).



Raymond Toy
Mon Jul 14 09:11:27 EDT 1997