Closed crb02005 closed 9 years ago
Do I understand the intent correctly?
To allow a main() function receiving no arguments to be called with arguments (arguments will be discarded)
If this is the case, why can't you just write a function like:
def main(*args, **kwargs):
("and ignore the the value of args, kwargs")
?
If you own all the scripts this function calls, they can be modified to support that. Is this ever going to call an external script? On Mar 3, 2015 11:39 PM, "Jeff Quast" notifications@github.com wrote:
Do I understand the intent correctly?
To allow a main() function receiving no arguments to be called with arguments (arguments will be discarded)
If this is the case, why can't you just write a function like:
def main(_args, *_kwargs): ("and ignore the the value of args, kwargs")
?
— Reply to this email directly or view it on GitHub https://github.com/jquast/x84/pull/259#issuecomment-77100273.
I don't follow, maybe you can provide a more precise use-case? Maybe we're not attacking the real problem here.
def function():
return 1
function(33, 99, some_keyword=101)
Why would you believe the above code should execute ?? It should absolutely fail. You've provided arguments that you certainly thought were expected and required.
"Explicit is better than Implicit"
I can't accept this:
You are absolute right.
Partially resolves issue with calling script with extra arguments.