Skip to content

Use == for text, numeric, and byte types #773

Description

@rmorshea

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 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions