qbatch icon indicating copy to clipboard operation
qbatch copied to clipboard

Alternate implementation of default arguments: document in description and set post-argparse

Open gdevenyi opened this issue 8 years ago • 4 comments

See comment here: http://python.6.x6.nabble.com/argparse-tell-if-arg-was-defaulted-tp1528162p1528165.html

This means having unset defaults in argparse, and then setting the values after parsing by checking for none.

I think this would resolve the chunk_size and ppj metaprogramming, my issues with the list appending, and possible other magics in a saner way.

Thoughts?

gdevenyi avatar Apr 26 '16 15:04 gdevenyi

I considered this, but then the default isn't shown in the help. We could write it into the help ourselves, I suppose.

pipitone avatar Apr 27 '16 02:04 pipitone

That's what my thought was. I think that would make the code quite a bit cleaner.

gdevenyi avatar Apr 27 '16 10:04 gdevenyi

That's what my thought was. I think that would make the code quite a bit cleaner.

Ah, I see now you had this idea in the issue title. :-)

pipitone avatar Apr 27 '16 12:04 pipitone

I'm good with this.

pipitone avatar May 10 '16 16:05 pipitone