Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rmorshea opened this issue Jun 23, 2022 · 0 comments · Fixed by #790
Closed

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

rmorshea opened this issue Jun 23, 2022 · 0 comments · Fixed by #790
Assignees
Labels
priority-1-high Should be resolved ASAP. type-refactor About improving code structure.
Milestone

Comments

@rmorshea
Copy link
Collaborator

rmorshea commented Jun 23, 2022

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

@rmorshea rmorshea added the flag-triage Not prioritized. label Jun 23, 2022
@Archmonger Archmonger added type-refactor About improving code structure. and removed flag-triage Not prioritized. labels Jun 29, 2022
@Archmonger Archmonger added this to the 1.0 milestone Jul 1, 2022
@rmorshea rmorshea added the priority-1-high Should be resolved ASAP. label Jul 1, 2022
@rmorshea rmorshea self-assigned this Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-1-high Should be resolved ASAP. type-refactor About improving code structure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants