21 |
21 |
22 def __call__(self, *args, **kwargs): |
22 def __call__(self, *args, **kwargs): |
23 return FakeObject(__classname__=self.__classname__+"()") |
23 return FakeObject(__classname__=self.__classname__+"()") |
24 |
24 |
25 def __getitem__(self, key): |
25 def __getitem__(self, key): |
26 raise IndexError(key) |
26 return FakeObject(__classname__=self.__classname__+"["+repr(key)+"]") |
27 |
27 |
28 def __str__(self): |
28 def __str__(self): |
29 return self.__classname__ |
29 return self.__classname__ |
30 |
30 |
31 def __or__(self, other): |
31 def __or__(self, other): |
32 return FakeObject(__classname__=self.__classname__+"|"+other.__classname__) |
32 return FakeObject(__classname__=self.__classname__+"|"+other.__classname__) |
|
33 |
|
34 def __hash__(self) -> int: |
|
35 return id(self) |
33 |
36 |
|
37 def __cmp__(self,other): |
|
38 return True |
|
39 __lt__=__cmp__ |
|
40 __le__=__cmp__ |
|
41 __eq__=__cmp__ |
|
42 __ne__=__cmp__ |
|
43 __gt__=__cmp__ |
|
44 __ge__=__cmp__ |
34 |
45 |
35 class FakeClass: |
46 class FakeClass: |
36 def __init__(self, *args, **kwargs): |
47 def __init__(self, *args, **kwargs): |
37 print(("DUMMY Class __init__ !",self.__name__,args,kwargs)) |
48 print(("DUMMY Class __init__ !",self.__name__,args,kwargs)) |
38 |
49 |