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)
| 505 | |
| 506 | |
| 507 | def 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 = { |
no outgoing calls