Skip to content

Decorum.__call__() should first check self._wrapped #24

@benoitbryon

Description

@benoitbryon

See https://github.com/zeekay/decorum/blob/0.5.3/decorum/decorum.py#L46
What about improving this code by checking self._wrapped first?

Something like:

if self._wrapped is None:
    if f is None:
        raise Exception('Need something to decorate!')
    return self.wraps(f)
else:
    return self._wrapped(*args, **kwargs)  # Actually run the decorated function.

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