Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Documentation for .register() method, plus let it accept a name #14

Closed
simonw opened this issue Jan 20, 2023 · 0 comments
Closed

Documentation for .register() method, plus let it accept a name #14

simonw opened this issue Jan 20, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Jan 20, 2023

The method currently looks like this:

def register(self, fn):
self._registry[fn.__name__] = fn
# Clear caches:
self._graph = None
self._reversed = None

This isn't yet documented. Also it would be neat if you could do this:

registry.register(lambda x: x.upper(), name="upper")

If name= is not provided it can default to fn.__name__.

@simonw simonw added enhancement New feature or request documentation Improvements or additions to documentation labels Jan 20, 2023
@simonw simonw closed this as completed in ddb71fd Jan 20, 2023
simonw added a commit that referenced this issue Apr 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant