def wrap_compile_time_constant(pos, value):
rep = repr(value)
- if isinstance(value, bool):
+ if value is None:
+ return ExprNodes.NoneNode(pos)
+ elif isinstance(value, bool):
return ExprNodes.BoolNode(pos, value=value)
elif isinstance(value, int):
return ExprNodes.IntNode(pos, value=rep)
_ERRORS = u"""
5:32: Error in compile-time expression: IndexError: tuple index out of range
-7:15: Invalid type for compile-time constant: None (type NoneType)
7:15: Invalid type for compile-time constant: [1, 2, 3] (type list)
"""
DEF TUPLE = (1, 2, u"buckle my shoe")
DEF TRUE_FALSE = (True, False)
+DEF NONE = None
DEF CHAR = c'x'
DEF INT0 = -1
"""
cdef int i = EXPRESSION
return i
+
+def none():
+ """
+ >>> none()
+ """
+ return NONE