hmr 0.5.2.1__py3-none-any.whl → 0.5.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hmr-0.5.2.1.dist-info → hmr-0.5.2.3.dist-info}/METADATA +2 -2
- {hmr-0.5.2.1.dist-info → hmr-0.5.2.3.dist-info}/RECORD +6 -6
- reactivity/hmr/core.py +2 -2
- reactivity/primitives.py +20 -2
- {hmr-0.5.2.1.dist-info → hmr-0.5.2.3.dist-info}/WHEEL +0 -0
- {hmr-0.5.2.1.dist-info → hmr-0.5.2.3.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: hmr
|
3
|
-
Version: 0.5.2.
|
3
|
+
Version: 0.5.2.3
|
4
4
|
Summary: Hot Module Reload for Python
|
5
5
|
Project-URL: repository, https://github.com/promplate/pyth-on-line/tree/reactivity
|
6
6
|
Requires-Python: >=3.12
|
@@ -11,7 +11,7 @@ Description-Content-Type: text/markdown
|
|
11
11
|
|
12
12
|
# HMR for Python
|
13
13
|
|
14
|
-
<sup> on-demand · fine-grained · pull
|
14
|
+
<sup> on-demand · fine-grained · push-pull reactivity </sup>
|
15
15
|
|
16
16
|
[](https://pypi.org/project/hmr/)
|
17
17
|
[](https://github.com/promplate/pyth-on-line/blob/reactivity/packages/hmr/pyproject.toml)
|
@@ -1,14 +1,14 @@
|
|
1
|
-
hmr-0.5.2.
|
2
|
-
hmr-0.5.2.
|
3
|
-
hmr-0.5.2.
|
1
|
+
hmr-0.5.2.3.dist-info/METADATA,sha256=brOwFOjTaxu3v-7VKwtAyecOo1zq1-hCEbW0zdXf6yA,2001
|
2
|
+
hmr-0.5.2.3.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
hmr-0.5.2.3.dist-info/entry_points.txt,sha256=g_T0uJ43WgsdG14kkkdaBQuIL0HO-m1qvtjXMP6d060,59
|
4
4
|
reactivity/__init__.py,sha256=pX-RUzkezCC1x4eOWGxNhXbwrbvBLP_3pQuZr9eZz1Y,300
|
5
5
|
reactivity/functional.py,sha256=jJLEq88w5ag2cXuD1T118uEjnEg37_mqvWmFkb47KVY,1300
|
6
6
|
reactivity/helpers.py,sha256=rcrCXy1mmlei-if_BN4nSgS2IG9kBj-jq1YRwEfcITo,5329
|
7
7
|
reactivity/hmr/__init__.py,sha256=S5ZIHqCRpevdzWuhS0aCua_S8F0LkK0YNg6IgeTScFQ,177
|
8
8
|
reactivity/hmr/__main__.py,sha256=uIcyjR5gMFIXH_3hS0B3SD00RirVf7GIct-uItx675o,64
|
9
9
|
reactivity/hmr/api.py,sha256=sKDQV7uKRVoDifTZKrLQGZP-fzgYbdVjfEOC6ki4NKY,2280
|
10
|
-
reactivity/hmr/core.py,sha256=
|
10
|
+
reactivity/hmr/core.py,sha256=JZcnF3fKpcNMiL6XKMZVjjLRxAods0I7I0BkwrVYZbU,11693
|
11
11
|
reactivity/hmr/hooks.py,sha256=jIFpe4CNxfaS9RcR4OIodx_sOZlnJ_IA1T1RtHPXhwU,945
|
12
12
|
reactivity/hmr/utils.py,sha256=h9m7iRXlvsLTrHoXV9gEVbhz3XsPK4KgnStYoCAWE5I,1616
|
13
|
-
reactivity/primitives.py,sha256=
|
14
|
-
hmr-0.5.2.
|
13
|
+
reactivity/primitives.py,sha256=alFH1W7y2UHgXI3Vlk8GFdIlcFTcQ3Q9cpz2Y1vDZuQ,6553
|
14
|
+
hmr-0.5.2.3.dist-info/RECORD,,
|
reactivity/hmr/core.py
CHANGED
@@ -79,7 +79,7 @@ class ReactiveModule(ModuleType):
|
|
79
79
|
self.__namespace_proxy = NamespaceProxy(namespace, self)
|
80
80
|
self.__file = file
|
81
81
|
|
82
|
-
|
82
|
+
__class__.instances[file.resolve()] = self
|
83
83
|
|
84
84
|
@property
|
85
85
|
def file(self):
|
@@ -341,4 +341,4 @@ def cli():
|
|
341
341
|
reloader.keep_watching_until_interrupt()
|
342
342
|
|
343
343
|
|
344
|
-
__version__ = "0.5.2.
|
344
|
+
__version__ = "0.5.2.3"
|
reactivity/primitives.py
CHANGED
@@ -3,6 +3,24 @@ from typing import Any, Self, overload
|
|
3
3
|
from weakref import WeakKeyDictionary, WeakSet
|
4
4
|
|
5
5
|
|
6
|
+
def _equal(a, b):
|
7
|
+
if a is b:
|
8
|
+
return True
|
9
|
+
comparison_result: Any = False
|
10
|
+
for i in range(3): # pandas DataFrame's .all() returns a Series, which is still incompatible :(
|
11
|
+
try:
|
12
|
+
if i == 0:
|
13
|
+
comparison_result = a == b
|
14
|
+
if comparison_result:
|
15
|
+
return True
|
16
|
+
except ValueError as e:
|
17
|
+
if ".all()" in str(e) and hasattr(comparison_result, "all"): # array-like instances
|
18
|
+
comparison_result = comparison_result.all()
|
19
|
+
else:
|
20
|
+
return False
|
21
|
+
return False
|
22
|
+
|
23
|
+
|
6
24
|
class Subscribable:
|
7
25
|
def __init__(self):
|
8
26
|
super().__init__()
|
@@ -69,7 +87,7 @@ class Signal[T](Subscribable):
|
|
69
87
|
return self._value
|
70
88
|
|
71
89
|
def set(self, value: T):
|
72
|
-
if not self._check_equality or self._value
|
90
|
+
if not self._check_equality or not _equal(self._value, value):
|
73
91
|
self._value = value
|
74
92
|
self.notify()
|
75
93
|
return True
|
@@ -186,7 +204,7 @@ class Derived[T](BaseDerived[T]):
|
|
186
204
|
value = self.fn()
|
187
205
|
self.dirty = False
|
188
206
|
if self._check_equality:
|
189
|
-
if value
|
207
|
+
if _equal(value, self._value):
|
190
208
|
return
|
191
209
|
elif self._value is self.UNSET: # do not notify on first set
|
192
210
|
self._value = value
|
File without changes
|
File without changes
|