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

fix(python): KeyError in type checks when decorating methods #3791

Merged
merged 1 commit into from
Oct 5, 2022

Commits on Oct 5, 2022

  1. fix(python): KeyError in type checks when decorating methods

    When methods are decorated by users (e.g: replaced with an alternate
    function that delegates back to the original one), type annotations are
    not carried over to the new function.
    
    Since type checking code relied on dynamically accessing the checked
    function for the purpose of getting type hints,this resulted in
    unexpected errors when executing type checking code.
    
    In order to address this, the type checking code now declares a stub
    function locally with the relevant type information in order to have a
    reliable/stable source of type annotations (these cannot be constructed
    dynamically as Python does not expose the necessary constructors).
    RomainMuller committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    860c0c0 View commit details
    Browse the repository at this point in the history