We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54f7fe1 commit 5f5112aCopy full SHA for 5f5112a
py/none.go
@@ -26,3 +26,28 @@ func (a NoneType) M__str__() Object {
26
// Check interface is satisfied
27
var _ I__bool__ = None
28
var _ I__str__ = None
29
+
30
+// Convert an Object to an NoneType
31
+//
32
+// Retrurns ok as to whether the conversion worked or not
33
+func convertToNoneType(other Object) (NoneType, bool) {
34
+ switch b := other.(type) {
35
+ case NoneType:
36
+ return b, true
37
+ }
38
+ return None, false
39
+}
40
41
+func (a NoneType) M__eq__(other Object) Object {
42
+ if _, ok := convertToNoneType(other); ok {
43
+ return True
44
45
+ return False
46
47
48
+func (a NoneType) M__ne__(other Object) Object {
49
50
51
52
53
0 commit comments