hiyapyco icon indicating copy to clipboard operation
hiyapyco copied to clipboard

improve arg eval

Open zerwes opened this issue 1 year ago • 0 comments

          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 https://github.com/zerwes/hiyapyco/pull/78#discussion_r1782635993

zerwes avatar Oct 18 '24 05:10 zerwes