Giter Site home page Giter Site logo

annotations and kwonlyargs about python-fire HOT 5 CLOSED

google avatar google commented on May 17, 2024
annotations and kwonlyargs

from python-fire.

Comments (5)

jgarst avatar jgarst commented on May 17, 2024 1

I've just submitted a pull request for the annotations part of this issue. The keyword only argument part of this bug bleeds over to a more invasive enhancement request, as you probably want to maintain the keyword only property on the command line.

It also seems like you are doing a lot of work to reproduce inspect.signature, such as dropping self and loading the arguments tuple by hand. You might want to look at a backport, though don't know the code quality, or your stance on dependencies.

from python-fire.

dbieber avatar dbieber commented on May 17, 2024

Thanks for finding and reporting this bug. I expect that checking the python version with six and then using inspect.getfullargspec for Python 3 will be the appropriate way to proceed.

from python-fire.

hapnewyear2017 avatar hapnewyear2017 commented on May 17, 2024

from fire import Fire

def test_args(arg1: str = 'aarrrgh', *, arg2: str = 'arrrgh'):
return arg2, arg2

if name == 'main':
Fire(test_args)

from python-fire.

Cologler avatar Cologler commented on May 17, 2024

Is possible auto convert argument type?

like:

def func(arg: int):
    print(type(arg)) # print int

from python-fire.

dbieber avatar dbieber commented on May 17, 2024

Merged #18

from python-fire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.