Skip to content

Base Operation constructor should call infer_annotations for all annotations in a signature #477

@eb8680

Description

@eb8680

Now that we're adding more effectful.ops.types.Annotation subtypes to control Operation behavior (see e.g. #222 #171 #448 #447), we should be more precise and explicit about the specification of Annotation.

Currently the only method on the abstract base class Annotation is infer_annotations, which takes an inspect.Signature and returns another Signature which may have had Annotations validated and added/removed/edited. This should be run in Operation.__init__, or if there are forward references (#450) perhaps the first time the __signature__ property is accessed (#451).

infer_annotations should also be idempotent and should not affect either the underlying un-annotated type or other Annotations that are not instances. This can just be enforced implicitly with documentation and unit tests for now.

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