Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass '2e9672320848' as a str value? #507

Closed
jump2cn opened this issue Apr 10, 2024 · 1 comment
Closed

How to pass '2e9672320848' as a str value? #507

jump2cn opened this issue Apr 10, 2024 · 1 comment

Comments

@jump2cn
Copy link

jump2cn commented Apr 10, 2024

import fire

def test(value: str = None):
    print('got value:', value)

if __name__ == '__main__':
    fire.Fire({
        'test': test
    })
> python test.py test "2e9672320848"
< got value: inf
@dbieber
Copy link
Member

dbieber commented Apr 30, 2024

One option is: python test.py test '"2e9672320848"'

Another option is to decorate your function with @fire.decorators.SetParseFn(str)

@dbieber dbieber closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants