Skip to content

autoreload should also update __annotations__, __type_params__, and __kwdefaults__ for functions #14968

@sczi

Description

@sczi
func_attrs = [
    "__code__",
    "__defaults__",
    "__doc__",
    "__closure__",
    "__globals__",
    "__dict__",
]

These are the attributes autoreload tries patching when updating a changed function. When using deduperreload (the default) it will also patch kwdefaults. imo kwdefaults should be added to func_attrs so it is patched when not using deduperreload, along with annotations and type_params which neither the old code or the new deduperreload is updating currently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions