Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Make blocks callable #4

Open
ixjlyons opened this issue Mar 9, 2017 · 1 comment
Open

Make blocks callable #4

ixjlyons opened this issue Mar 9, 2017 · 1 comment

Comments

@ixjlyons
Copy link
Member

ixjlyons commented Mar 9, 2017

In some cases, it would be better to simply treat blocks as if they were functions. Many blocks really should just be functions anyway, since they don't need to carry state. This would also make CallablePipelineBlock totally unnecessary.

A simple solution would be to just add this to PipelineBlock:

def __call__(self, *args, **kwargs):
    return self.process(*args, **kwargs)

A better solution would probably be to just get rid of the process method altogether.

@ixjlyons
Copy link
Member Author

Addressed for now with bd67c67. Not closing for now -- I'd like to think a bit more about this plus it should be documented somewhere.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant