This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年02月10日 15:48 by bethard, last changed 2022年04月11日 14:57 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| argparse_simple_example.diff | groodt, 2012年07月07日 10:13 | review | ||
| issue11165-doc-fix-up-to-section-15.4.4.diff | dlam, 2012年07月09日 06:11 | review | ||
| 1176_minor_edits.diff | groodt, 2012年07月09日 19:53 | review | ||
| issue11176.patch | dlam, 2012年08月28日 09:33 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 26279 | open | Bonifacio2, 2021年05月21日 11:09 | |
| Messages (22) | |||
|---|---|---|---|
| msg128302 - (view) | Author: Steven Bethard (bethard) * (Python committer) | Date: 2011年02月10日 15:48 | |
Suggestion from a personal email: I personally am not keen on the foo/bar/baz examples. I know that you're trying to be generic but IMO it would be much easier to understand if you used meaningful names. Also, I think that the very first example you give (which does use meaningful names:-) is too clever. I'd suggest using something simpler: in fact I'd use exactly the same example that optparse uses (--file && --quiet) since that is easy to understand and relate to straight away, and maybe add a --line option that takes a list of ints (ostensibly line numbers of lines to extract from the file) if you want to show that argparse leaves optparse in the dust. And you can always show how to get actual file objects later on. |
|||
| msg128355 - (view) | Author: Westley Martínez (westley.martinez) * | Date: 2011年02月11日 00:23 | |
I agree; it's too artsy. I'll see if I can come up with a relevant and clever alternative. |
|||
| msg140679 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年07月19日 16:04 | |
Hi Westley! Do you still have time to work on this? |
|||
| msg140685 - (view) | Author: Westley Martínez (westley.martinez) * | Date: 2011年07月19日 18:04 | |
I worked on this some time ago; the problem was the size of the documentation, i.e. it was difficult to stay consistent. Do I have time for this? Yes, but I wouldn't get it done anytime soon, and the results could be anywhere from good to bad. As it stands, the documentation is fairly good, so I don't think it's imperative to fix it. |
|||
| msg140745 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年07月20日 15:11 | |
> I worked on this some time ago; the problem was the size of the > documentation, i.e. it was difficult to stay consistent. I think it’s okay to improve the docs one patch at a time, starting with the simple example referenced in the first message in this bug report, and gradually improving other sections. Do you have a diff with your work, so that your efforts can serve as a base for someone else? > Do I have time for this? Yes, but I wouldn't get it done anytime > soon, and the results could be anywhere from good to bad. That’s why we do reviews :) It’s okay if you don’t have time, I’m interested in working on this some time in the future. |
|||
| msg164802 - (view) | Author: Greg Roodt (groodt) * | Date: 2012年07月07日 10:13 | |
Is this still an issue? If so, I've created a simpler first example as suggested below. If we decide these docs still need a bit more work, I can also continue to provide better examples than the "foo bar" ones. |
|||
| msg165059 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年07月09日 04:56 | |
Yep, this is still open. Thanks for the patch, I did a review (if you did not get a mail, follow the link in the list of files). |
|||
| msg165068 - (view) | Author: David Lam (dlam) * | Date: 2012年07月09日 06:11 | |
haha wow, I was working on this bug too! maybe we can work on the final patch together I got through about 2/3's of the docs, so I thought it might help to upload what I got so far. I basically just made stuff up so I'm totally winning to change anything (or everything) I made a little effort to make the examples mildly amusing, since novelty sorta helps in retention. So one of the recurring examples I used involves that of a pizza-making-program... hopefully this helps in some way! |
|||
| msg165109 - (view) | Author: Greg Roodt (groodt) * | Date: 2012年07月09日 19:02 | |
Hi David Ok, I like the idea of working on a solution together. I like your idea of the pizza-making more than the current "foo bar" examples. Should we collaborate outside of the bug tracker? Greg On 9 July 2012 07:11, David Lam <report@bugs.python.org> wrote: > > David Lam <d@dlam.me> added the comment: > > haha wow, I was working on this bug too! maybe we can work on the final > patch together > > I got through about 2/3's of the docs, so I thought it might help to > upload what I got so far. I basically just made stuff up so I'm totally > winning to change anything (or everything) > > I made a little effort to make the examples mildly amusing, since novelty > sorta helps in retention. So one of the recurring examples I used involves > that of a pizza-making-program... hopefully this helps in some way! > > ---------- > nosy: +dlam > Added file: > http://bugs.python.org/file26325/issue11165-doc-fix-up-to-section-15.4.4.diff > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue11176> > _______________________________________ > |
|||
| msg165115 - (view) | Author: Greg Roodt (groodt) * | Date: 2012年07月09日 19:53 | |
I've made the minor edits required after the review to my simplification of the first example. David, perhaps we combine our efforts? Use my simple first example to explain the very basics, then continue the explanation with the pizza example? Im happy either way, I quite like your example using the system dictionary. |
|||
| msg165731 - (view) | Author: David Lam (dlam) * | Date: 2012年07月17日 21:49 | |
yup yup, go for it |
|||
| msg166182 - (view) | Author: Steven Bethard (bethard) * (Python committer) | Date: 2012年07月22日 23:37 | |
Thanks for working on this! I think keeping the first example as simple is possible is probably a good idea. And I didn't have time to read through the whole patch, but as far as I went, the pizza examples looked great. |
|||
| msg169258 - (view) | Author: David Lam (dlam) * | Date: 2012年08月28日 09:33 | |
here's a patch that covers all but one of the foo/bar/baz examples it also has fixes for the sample code near the beginning from the review Ezio did the one example I didn't do was the "Arguments containing -" part. I guess it felt like changing the names in that example would distract from what it was trying to illustrate there Anyways, I tried to proofread it so hopefully it reads okay, enjoy enjoy ^^ |
|||
| msg177641 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2012年12月17日 10:49 | |
Also see this e-mail to docs@: http://mail.python.org/pipermail/docs/2012-December/012028.html > Subject: [docs] FOO and BAR > > Do you think it would be possible to write your documentation avoiding the silly usage of FOO and BAR everywhere? This is a very very old and boring joke, and does nothing to clarify what you are trying to clarify. If you could include real-world examples in your documentation, rather than "clever" programmer "jokes", learners such as myself would have far more respect for the good work you are obviously doing here. > > For example, the section on argparser is full of this sort of rubbish: > argparse.ArgumentParser(description='A foo that bars') > > Under what circumstances would you ever put that in a program? Are you mad? > > Please take this into consideration. |
|||
| msg179764 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2013年01月12日 03:36 | |
Issue 16933 improved the "choices" examples. |
|||
| msg198350 - (view) | Author: Westley Martínez (westley.martinez) * | Date: 2013年09月24日 02:55 | |
I've skimmed through the patches. Good job kids. This is much better than it was before. No more of that silly command-line calculator or the foobar nonsense that sounds drier than the POSIX standard. Is there anything else that needs to be done? |
|||
| msg199034 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2013年10月06日 06:59 | |
> Also see this e-mail to docs@: > http://mail.python.org/pipermail/docs/2012-December/012028.html No, please don't see this e-mail. It's not worth it. The poster clearly has no clue whatsoever about either a) common placeholders, or b) manners. I don't want to claim that foo/bar/etc. are superior to a well-thought-out example (which takes time to come up with), but they are certainly better than no example at all. |
|||
| msg220779 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年06月16日 22:47 | |
If we've got some meaningful changes can we please get them committed. However I'd like to state that with over 4000 issues open we've got better things to do than change docs because somebody doesn't like the use of foo, bar and baz in examples. |
|||
| msg229510 - (view) | Author: Steve (lonetwin) | Date: 2014年10月16日 07:18 | |
I came here to file a bug against the argparse documentation because reading through the documentation I didn't realize a good usecase for the `epilog` argument to the `ArgumentParser()` class until I started noticing that some commandline tools end with examples of usage. I found this bug and so thought it would be better to just leave a comment here instead. I glaced through the submitted patches and noticed that the pizza making example has `epilog="Remember: select a good combination to ensure maximum tastiness` ...which while good, still might not immediately convey the usefulness of the epilog parameter (just IMHO). I think, the example would be better served by something like: >>> pizza_parser = argparse.ArgumentParser( ... description='Make a pizza out of ingredients and toppings', ... epilog="""Examples: Create a Python Lovers pizza using the command:: ... ./makepizz.py spam ham eggs ... """) Of course this example would then also require passing a formatter_class argument to handle the wrapping ...but in essence the point of my comment is that the examples might be more useful if a 'real-world' usage is demonstrated. |
|||
| msg393842 - (view) | Author: Bonifacio (Bonifacio2) * | Date: 2021年05月17日 23:17 | |
I tried applying the latest patch version but it failed. Are the original authors still interested in moving forward with this patch? If not then I could give this issue a try. |
|||
| msg393974 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年05月19日 20:59 | |
It's been over six years, go for it. |
|||
| msg394613 - (view) | Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) | Date: 2021年05月27日 22:40 | |
Can you give the original authors some credit too on the PR, if you built on their work, please? We usually do it by putting co-author: <email> in the PR comment. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:12 | admin | set | github: 55385 |
| 2021年05月27日 22:40:14 | nanjekyejoannah | set | nosy:
+ nanjekyejoannah messages: + msg394613 |
| 2021年05月21日 11:09:08 | Bonifacio2 | set | stage: needs patch -> patch review pull_requests: + pull_request24885 |
| 2021年05月19日 20:59:07 | iritkatriel | set | nosy:
+ iritkatriel messages: + msg393974 |
| 2021年05月17日 23:17:20 | Bonifacio2 | set | nosy:
+ Bonifacio2 messages: + msg393842 |
| 2020年11月06日 22:30:37 | iritkatriel | set | title: give more meaningful argument names in argparse documentation -> [doc] give more meaningful argument names in argparse documentation versions: + Python 3.8, Python 3.9, Python 3.10, - Python 2.7, Python 3.2, Python 3.3 |
| 2019年04月26日 17:44:59 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2014年10月16日 07:18:18 | lonetwin | set | nosy:
+ lonetwin messages: + msg229510 |
| 2014年06月16日 22:47:06 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg220779 |
| 2013年10月06日 06:59:11 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg199034 |
| 2013年09月24日 02:55:35 | westley.martinez | set | messages: + msg198350 |
| 2013年01月12日 03:36:48 | chris.jerdonek | set | messages: + msg179764 |
| 2012年12月17日 10:49:18 | chris.jerdonek | set | nosy:
+ chris.jerdonek messages: + msg177641 |
| 2012年08月28日 09:33:15 | dlam | set | files:
+ issue11176.patch messages: + msg169258 |
| 2012年07月22日 23:37:07 | bethard | set | messages: + msg166182 |
| 2012年07月17日 21:49:50 | dlam | set | messages: + msg165731 |
| 2012年07月09日 19:53:23 | groodt | set | files:
+ 1176_minor_edits.diff messages: + msg165115 |
| 2012年07月09日 19:02:46 | groodt | set | messages: + msg165109 |
| 2012年07月09日 06:11:33 | dlam | set | files:
+ issue11165-doc-fix-up-to-section-15.4.4.diff nosy: + dlam messages: + msg165068 |
| 2012年07月09日 04:56:51 | eric.araujo | set | assignee: eric.araujo -> messages: + msg165059 nosy: + ezio.melotti, sandro.tosi |
| 2012年07月07日 10:13:34 | groodt | set | files:
+ argparse_simple_example.diff nosy: + groodt messages: + msg164802 keywords: + patch |
| 2012年03月18日 21:35:25 | tshepang | set | nosy:
+ tshepang |
| 2011年09月19日 14:04:31 | marcs | set | nosy:
+ marcs |
| 2011年08月31日 03:03:58 | adam.woodbeck | set | nosy:
+ adam.woodbeck |
| 2011年07月20日 15:11:52 | eric.araujo | set | assignee: docs@python -> eric.araujo messages: + msg140745 |
| 2011年07月19日 18:04:49 | westley.martinez | set | messages: + msg140685 |
| 2011年07月19日 16:04:49 | eric.araujo | set | versions:
+ Python 2.7, Python 3.2 nosy: + eric.araujo messages: + msg140679 keywords: + easy |
| 2011年02月11日 00:23:44 | westley.martinez | set | nosy:
+ westley.martinez messages: + msg128355 |
| 2011年02月10日 15:48:55 | bethard | create | |