Skip to content

Implement @documented decorator for functions #4

@anatoly-scherbakov

Description

@anatoly-scherbakov
@documented
def calculate_customers_report(customers: List[Customer], requested_by: User) -> CustomerReport:
    """
    Build customers report.

    Requested by: {requested_by}.
    """

When this function is executed, the following message can be printed:

Build customers report.

Requested by: John Doe.

Before executing the function, its wrapper will substitute the arguments of the function call into the docstring and then will print the docstring using built-in Python logging system.

Purpose of this is to illustrate what is happening in the program in a human readable way in its log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions