on-internet
← Community

Redundant keyword arguments

Stack Overflow ·

I found that writing a function which is a wrapper around another one can lead to "redundant" keyword arguments. For example look at this few lines: def check_then_execute(foo=1, bar="A"): foo = safe(foo) # will return foo in a safe form bar = safe(bar) execute(foo=foo, bar=bar) # doesn't it feel redundant? In this example execute() is a library function that has keyword arguments. Possibly more than two. Is there a way to pass keyword arguments using the name of the variable as the keyword?

Comments

Sign in or sign up to comment and upvote.

No comments yet.