G
Gonçalo Rodrigues
Hi all,
I just noticed the following fact:
.... print "Arg is %s." % arg
.... Arg is 0.
Even "worse":
.... print "Args: %s, %s." % (arg1, arg2)
....
Does this "feature" of being able to treat positional arguments as
named arguments have any use? Does anybody make any use of it? Is
there any rationale on why it's in the language?
I'm asking this, because if we define equivalence of functions
signatures in the obvious way ("they accept the same calls") then
def f(arg):
....
def g(name):
....
don't have equivalent signatures because f can be called with (arg =
0) which does not work with g. It looks... wrong (maybe because what I
have in my mind is the mathematical concept of a function where named
arguments do not exist).
This is no big deal of course, just a curiosity.
With my best regards,
G. Rodrigues
I just noticed the following fact:
.... print "Arg is %s." % arg
.... Arg is 0.
Even "worse":
.... print "Args: %s, %s." % (arg1, arg2)
....
Does this "feature" of being able to treat positional arguments as
named arguments have any use? Does anybody make any use of it? Is
there any rationale on why it's in the language?
I'm asking this, because if we define equivalence of functions
signatures in the obvious way ("they accept the same calls") then
def f(arg):
....
def g(name):
....
don't have equivalent signatures because f can be called with (arg =
0) which does not work with g. It looks... wrong (maybe because what I
have in my mind is the mathematical concept of a function where named
arguments do not exist).
This is no big deal of course, just a curiosity.
With my best regards,
G. Rodrigues