Commits

Greg Price  committed 0bfc606

Support None in signatures (handy for return types!)

  • Participants
  • Parent commits f48ed5f
  • Branches signatures

Comments (0)

Files changed (2)

File pypy/annotation/types.py

 from pypy.annotation.listdef import ListDef
 
 
+def none():
+    return model.s_None
+
+
 def float():
     return model.SomeFloat()
 

File pypy/rlib/test/test_signature.py

         return s
 
 
+def test_signature_none():
+    @signature(returns=types.none())
+    def f():
+        pass
+    assert getsig(f) == [model.s_None]
+
 def test_signature_float():
     @signature(types.longfloat(), types.singlefloat(), returns=types.float())
     def f(a, b):