python - Ignore passed arguments -
is possible ignore passed/overgiven arguments in method?
here example want do:
def event_handler(one, two): print(one) print(two)
and @ place:
event_handler(one, two, three)
i mean third argument optional. i've tried in python fiddle, doesn't work without error.
make third default argument
def event_handler(one, two, third = none):
then error handling, default, easy.
def event_handler(one, two, third = none): print(one) print(two) if (three): print(three)
Comments
Post a Comment