Skip to content

unexpected behavior with duplicate value for the same argument  #25

@the-realtom

Description

@the-realtom

This is the code I'm running:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions