From a9b866bd76586a440918130d52ca933529ac521a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Sat, 25 Apr 2020 16:40:42 +0200
Subject: [PATCH] improve HashableWrapper + multiple bugfixes for Proxy

---
 CHANGELOG.md                                  | 3 ++-
 satella/__init__.py                           | 2 +-
 satella/coding/structures/hashable_objects.py | 1 +
 satella/coding/structures/proxy.py            | 2 +-
 tests/test_instrumentation/test_memory.py     | 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06486e1d..2a8f8b00 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 # v2.7.14
 
-* _TBA_
+* multiple bugfixes for `Proxy` object
+* bugfix for `HashableWrapper`: now it works
 
 # v2.7.13
 
diff --git a/satella/__init__.py b/satella/__init__.py
index 698cfa05..3cdf3b26 100644
--- a/satella/__init__.py
+++ b/satella/__init__.py
@@ -1 +1 @@
-__version__ = '2.7.14_a1'
+__version__ = '2.7.14_a2'
diff --git a/satella/coding/structures/hashable_objects.py b/satella/coding/structures/hashable_objects.py
index 33a8fb51..43e23b32 100644
--- a/satella/coding/structures/hashable_objects.py
+++ b/satella/coding/structures/hashable_objects.py
@@ -17,6 +17,7 @@ class HashableWrapper(Proxy):
     >>> a.a = 4
     >>> assert a.a == 4
     """
+    __slots__ = ()
 
     def __hash__(self):
         return hash(id(self))
diff --git a/satella/coding/structures/proxy.py b/satella/coding/structures/proxy.py
index 3d5109d2..9ff50c61 100644
--- a/satella/coding/structures/proxy.py
+++ b/satella/coding/structures/proxy.py
@@ -117,7 +117,7 @@ class Proxy(tp.Generic[T]):
         return self.__obj or other
 
     def __and__(self, other):
-        return self.__obj or other
+        return self.__obj and other
 
     def __le__(self, other):
         return self.__obj <= other
diff --git a/tests/test_instrumentation/test_memory.py b/tests/test_instrumentation/test_memory.py
index 4312b40e..264d985f 100644
--- a/tests/test_instrumentation/test_memory.py
+++ b/tests/test_instrumentation/test_memory.py
@@ -63,5 +63,5 @@ class TestMemory(unittest.TestCase):
         self.assertTrue(a['memory'])
         a['level_2_engaged'] = True
         time.sleep(3)
-        self.assertEqual(a['times_entered_1'], 2)
+        self.assertEqual(a['times_entered_1'], 3)
         self.assertTrue(a['level_2_confirmed'])
-- 
GitLab