MCPcopy Index your code
hub / github.com/reactive-python/reactpy / strictly_equal

Function strictly_equal

src/py/reactpy/reactpy/core/hooks.py:507–520  ·  view source on GitHub ↗

Check if two values are identical or, for a limited set or types, equal. Only the following types are checked for equality rather than identity: - ``int`` - ``float`` - ``complex`` - ``str`` - ``bytes`` - ``bytearray`` - ``memoryview``

(x: Any, y: Any)

Source from the content-addressed store, hash-verified

505
506
507def strictly_equal(x: Any, y: Any) -> bool:
508 """Check if two values are identical or, for a limited set or types, equal.
509
510 Only the following types are checked for equality rather than identity:
511
512 - ``int``
513 - ``float``
514 - ``complex``
515 - ``str``
516 - ``bytes``
517 - ``bytearray``
518 - ``memoryview``
519 """
520 return x is y or (type(x) in _NUMERIC_TEXT_BINARY_TYPES and x == y)
521
522
523_NUMERIC_TEXT_BINARY_TYPES = {

Callers 3

test_strictly_equalFunction · 0.90
dispatchMethod · 0.85
use_memoFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_strictly_equalFunction · 0.72