Skip to content

The hash and equals methods of code objects are large, complex and unnecessary. #101346

Open
@markshannon

Description

@markshannon

We should just compare code objects by identity.

Technically, they are immutable values but realistically, there is only on code object per source unit.
Attempting to maintain value semantics when the underlying code object is internally mutable (due to specialization and instrumentation) is cumbersome and probably buggy, and will only get worse with more optimizations.

We should just delete the hash and comparison methods and have identity comparison. It will be faster too.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions