You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in hooks, we use is to check whether or not two things are the same for all given values. This is not how strict equality in works in Javascript. Doing this also makes it difficult to limit effect triggers and memoized function calls.
Further, identity comparison for int will produce weird results since we can assert 1 is 1 but not assert 1000 is 1000.
Proposed Actions
Use == to compare the following types in hooks:
int
float
complex
str
bytes
bytearray
memoryview
We'll need to implement a strictly_equal function since we'll need this comparison behavior in a lot of places through hooks.py
The text was updated successfully, but these errors were encountered:
Current Situation
Currently in hooks, we use
is
to check whether or not two things are the same for all given values. This is not how strict equality in works in Javascript. Doing this also makes it difficult to limit effect triggers and memoized function calls.Further, identity comparison for
int
will produce weird results since we canassert 1 is 1
but notassert 1000 is 1000
.Proposed Actions
Use
==
to compare the following types in hooks:We'll need to implement a
strictly_equal
function since we'll need this comparison behavior in a lot of places throughhooks.py
The text was updated successfully, but these errors were encountered: