You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import fire
def test_duplicates(apples, paddles, oranges='10'):
print('There are {} apples'.format(apples))
print('There are {} paddles'.format(paddles))
print('There are {} oranges'.format(oranges))
if __name__ == '__main__':
fire.Fire(test_duplicates)
I am running python3 test.py 110 67 --apples=99 and producing the following result:
There are 99 apples
There are 110 paddles
There are 67 oranges
I see how Fire is evaluating the input, but if I'm not mistaken a positional and keyword argument collision should throw an error of some sort. I haven't looked under the hood yet but does this need a fix or am I using the command line wrong?
The text was updated successfully, but these errors were encountered:
This is an interesting case. How did you come upon it?
As a user of this Fire CLI, if I write python3 test.py 110 67 --apples=99, then I certainly intend for apples to be 99, but it's unclear whether I want paddles and oranges to be 110 and 67, or whether I am trying to set apples yet again, in which case an error would be appropriate. I don't see a compelling reason for preferring the error over the more forgiving interpretation. We currently take the more forgiving approach.
This is the code I'm running:
I am running
python3 test.py 110 67 --apples=99
and producing the following result:I see how Fire is evaluating the input, but if I'm not mistaken a positional and keyword argument collision should throw an error of some sort. I haven't looked under the hood yet but does this need a fix or am I using the command line wrong?
The text was updated successfully, but these errors were encountered: