Git Product home page Git Product logo

Comments (6)

puzrin avatar puzrin commented on July 24, 2024

It's too late to change API imho. Package is stable. I could consider some change, but only if someone decide to resync this port with latest argparse - that will be a reason to release 2.0.

About 'int' and so on... This is port, it should be as similar as possible. Also, some python types have no equivalent in js. Number is float in js, while int is integer in python.

from argparse.

monolithed avatar monolithed commented on July 24, 2024

You are right, these changes can only be considered in release 2.0.

This is port, it should be as similar as possible.
Also, some python types have no equivalent in js. Number is float in js, while int is integer in python.

That's why I prefer the last example )

from argparse.

puzrin avatar puzrin commented on July 24, 2024

Imho the best we can do now is to add note to differences list https://github.com/nodeca/argparse#argparse.

I'll keep this open, but honestly, no plans to resync port.

from argparse.

puzrin avatar puzrin commented on July 24, 2024

Probably we could support both camelCase & snake_case.

from argparse.

monolithed avatar monolithed commented on July 24, 2024

👍

from argparse.

rlidwka avatar rlidwka commented on July 24, 2024

Fixed as part of argparse 2.0.

Use it now like this:

{
     const: ['int' | 'str' | Number | String | ...]
     action: ['store_const' | 'append_const' | ...]
}

Note that while int and str are functions in python, we support them as strings 'int' and 'str' for convenience.

from argparse.

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.