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

function node can return the source of function rather than only the source of file #4554

Merged
merged 1 commit into from
Nov 2, 2022

Commits on Oct 27, 2022

  1. Process functions: Add the get_source_code_function method

    This method returns the source code of just the process function itself,
    i.e., the wrapped function plus the decorator itself.
    
    The existing method `get_function_source_code` would return the source
    code of the entire file in which the process function was defined, but
    this can at times include a lot of other code that is not always useful
    to have. The `get_function_source_code` method is deprecated and replaced
    by the `get_source_code_file` method to have consistent naming.
    
    The `get_source_code_function` implementation retrieves the source code
    of the function by calling `get_source_code_file` and extracting just
    the lines of the function. This is accomplished by using the starting
    line of the function, which already used to be stored, combined with the
    total number of lines that make up the function, which is an attribute
    that is stored from now on for process functions.
    unkcpz authored and Sebastiaan Huber committed Oct 27, 2022
    Configuration menu
    Copy the full SHA
    ce1ad67 View commit details
    Browse the repository at this point in the history