[Pyrex] kw-only arguments?
Stefan Behnel
stefan_ml at behnel.de
Thu Sep 20 07:51:08 CEST 2007
Hi,
is there a way to keep keyword arguments from taking a positional parameter?
If you have this:
def func(a, b, kw1=None, kw2=None):
....
I can always call it as
func(1,2,3,4)
However, sometimes this is unwanted, as keyword arguments have the advantage
of not *requiring* a specific position, so they allow me to change their
appearance in the signature without breaking any code (e.g. start using
**kwargs in wrappers instead of accepting them straight). But if people use
them as positional arguments (because it's 'convenient'), usually for the
first one or two arguments, this no longer holds.
Is there a way to do this or would it require a new syntax? (like a '|'
separator or something?)
Stefan
More information about the Pyrex
mailing list