Skip to content

Can a function be decorated "tube"? Or only a class? #82

@jMyles

Description

@jMyles

From the docstring on tube:

    """
    L{tube} is a class decorator which declares a given class to be an
    implementer of L{ITube} and fills out any methods or attributes which are
    not present on the decorated type with null-implementation methods (those
    which return None) and None attributes.

    @param cls: A class with some or all of the attributes or methods described
        by L{ITube}.

However, the readme shows:

@tube
def numbersToLines(value):
    yield str(value).encode("ascii")

Indeed, when I try to decorate a function, I get:

zope.interface.exceptions.BrokenMethodImplementation: The implementation of started violates its because implementation requires too many arguments.     

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