forked from restlet/restlet-framework-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjser2_classes.py
More file actions
47 lines (42 loc) · 1.43 KB
/
jser2_classes.py
File metadata and controls
47 lines (42 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from java.io import Serializable
from java.lang import Object
class A:
def __init__(self, a):
self.a = a
def __eq__(self, other):
return self.__class__ == other.__class__ and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class AJ(Object, Serializable):
def __init__(self, a):
self.a = a
def __eq__(self, other):
return self.__class__ == other.__class__ and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class N(object):
def __init__(self, a):
self.a = a
def __eq__(self, other):
return self.__class__ == other.__class__ and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class NL(list):
def __init__(self, a, *x):
list.__init__(self, x)
self.a = a
def __eq__(self, other):
return (self.__class__ == other.__class__ and list.__eq__(self, other) and
self.__dict__ == other.__dict__)
def __ne__(self, other):
return not (self == other)
class NT(tuple):
def __new__(typ, a, *x):
nt = tuple.__new__(typ, x)
nt.a = a
return nt
def __eq__(self, other):
return (self.__class__ == other.__class__ and tuple.__eq__(self, other) and
self.__dict__ == other.__dict__)
def __ne__(self, other):
return not (self == other)