Message175377
| Author |
terry.reedy |
| Recipients |
Juraj.Variny, bethard, chris.jerdonek, docs@python, ezio.melotti, r.david.murray, terry.reedy |
| Date |
2012年11月11日.17:53:22 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1352656402.38.0.843121187183.issue16418@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Juraj: Is the example behavior from Py2 or Py3? The meaning of 'range' changed. In Py2, xrange would be the correct choice for 'choice'.
Does argparse actually convert (x)range objects to a list or set (the help indicates the latter) for internal use? That would be foolish as 'n in <range>' is an O(1) operation. (I don't remember is that works for xrange.) For instance, range(0, 1000, 2) is a nice way to say 'even count less than 1000'.
If it is not so converted, converting for display is also foolish.
'range(0, 1000, 2)' is clearer than an explicit sequence. |
|