beremiz

45accb98d761
Parents 3e219f00151a
Children eafb8f000584
Fake_wx objects now support comparison and hashing
  • +12 -1
    fake_wx.py
  • --- a/fake_wx.py Sat May 20 00:33:22 2023 +0200
    +++ b/fake_wx.py Sat May 20 00:35:41 2023 +0200
    @@ -23,14 +23,25 @@
    return FakeObject(__classname__=self.__classname__+"()")
    def __getitem__(self, key):
    - raise IndexError(key)
    + return FakeObject(__classname__=self.__classname__+"["+repr(key)+"]")
    def __str__(self):
    return self.__classname__
    def __or__(self, other):
    return FakeObject(__classname__=self.__classname__+"|"+other.__classname__)
    +
    + def __hash__(self) -> int:
    + return id(self)
    + def __cmp__(self,other):
    + return True
    + __lt__=__cmp__
    + __le__=__cmp__
    + __eq__=__cmp__
    + __ne__=__cmp__
    + __gt__=__cmp__
    + __ge__=__cmp__
    class FakeClass:
    def __init__(self, *args, **kwargs):