Skip to content

Add version number to code object, to provide initial version for functions. #446

@markshannon

Description

@markshannon

Calls to nested functions and comprehensions specialize poorly, if at all, because each individual function gets a different version, even though they are essentially the same.

Nested functions can have different defaults, or annotations. However we do not care what either of those are when testing the version. Comprehension functions don't have defaults or annotations.
We just care that the parameters are unchanged and that the number of defaults hasn't changed.

By giving each code object a globally unique id, we can copy that id into the function's version number when the function is created in byteode. All functions with the same code object and number of defaults would have the same version number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12Things we intend to do for 3.12epic-specializationMore specialization work for 3.12

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions