Author: Ronan Lamy <[email protected]>
Branch: 
Changeset: r71736:3bd72bcbe792
Date: 2014-05-26 18:58 +0100
http://bitbucket.org/pypy/pypy/changeset/3bd72bcbe792/

Log:    create class SomeNone

diff --git a/rpython/annotator/model.py b/rpython/annotator/model.py
--- a/rpython/annotator/model.py
+++ b/rpython/annotator/model.py
@@ -505,6 +505,28 @@
         else:
             return kt.__name__
 
+class SomeNone(SomePBC):
+    can_be_None = True
+    subset_of = None
+    knowntype = type(None)
+    const = None
+
+    def __init__(self):
+        pass
+
+    def isNone(self):
+        return True
+
+    @property
+    def descriptions(self):
+        return set()
+
+    def is_constant(self):
+        return True
+
+    def is_immutable_constant(self):
+        return True
+
 class SomeConstantType(SomePBC):
     can_be_None = False
     subset_of = None
@@ -557,7 +579,7 @@
         return False
 
 
-s_None = SomePBC([], can_be_None=True)
+s_None = SomeNone()
 s_Bool = SomeBool()
 s_Int = SomeInteger()
 s_ImpossibleValue = SomeImpossibleValue()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to