Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow for user supplied functions in compiled mode #1069

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

franzhaas
Copy link

@franzhaas franzhaas commented Feb 4, 2024

This fixes #1065

It adds a dictionary "userfunction" which works the same as linkedbuilders / linkedparsers. This dictionary is used to store the user supplied functions which are then referenced in the compiled construct.

The decission weather or not we have a user supplied function at hand is donne by.:

if isinstance(self.func, ExprMixin) or (not callable(self.func)):
    #dont use the userfunction 
else:
    #use the userfunction   

Rebuild is not the only place where this makes sense. "IfThenElse" and "Switch" can also benefit of this improvement.

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

Successfully merging this pull request may close these issues.

Using custom functions in Rebuild
1 participant