Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@rmorshea

Description

@rmorshea
Issue body actions

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.