I am trying to make my code NOT to accept keyword arguments just like some bulitins also do not accept keyword arguments, but, I am unable to do so. Here, is my thinking acc
You can use arbitrary argument lists to do this. See http://docs.python.org/tutorial/controlflow.html#arbitrary-argument-lists
For example:
def somefunc(*args):
print args[0], args[1]
Calling without keywords:
somefunc(10,20)
Gives:
10 20
Calling with keywords:
somefunc(a=10,b=20)
Gives an error:
TypeError: someFunc() got an unexpected keyword argument 'a'
It's unclear why you would want to do this though.