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

improve arg eval #81

Open
zerwes opened this issue Oct 18, 2024 · 0 comments
Open

improve arg eval #81

zerwes opened this issue Oct 18, 2024 · 0 comments

Comments

@zerwes
Copy link
Owner

zerwes commented Oct 18, 2024

          Is there a reason why arguments are evaulated in such a (IMO) cumbersome way? This could be just a keyword argument to the function instead of manually fiddling with `kwargs`... I would probably have implemented it like that when starting from scratch:
NoneBehavior = Enum("NoneBehavior", ["DEFAULT", "OVERRIDE"])

def __init__(self, *args, none_behavior: NoneBehavior = None, **kwargs):
    if none_behavior not in NoneBehavior:
        raise HiYaPyCoInvocationException(f"Undefined non_behavior, must be one of {', '.join(NoneBehavior._member_names_}")
    self.none_behavior = none_behavior

Originally posted by @grst in #78 (comment)

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

No branches or pull requests

1 participant