Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80260
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: Understanding "help" command description syntax - explanation needed |
| Date | 2014-11-05 12:04 +0000 |
| References | <000001cff8e7$af51ef30$0df5cd90$@gmail.com> <88543346.5460.1415188500802.JavaMail.root@sequans.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.15488.1415189062.18130.python-list@python.org> (permalink) |
On 05/11/2014 11:55, Jean-Michel Pichavant wrote: > ---- Original Message ----- >> From: "Ivan Evstegneev" <webmailgroups@gmail.com> >> To: python-list@python.org >> Sent: Wednesday, 5 November, 2014 12:00:16 PM >> Subject: Understanding "help" command description syntax - explanation needed >> So here is the question itself: >> >> If I use the help command to check the “range” command I get this >> info: >> >> >> >> range(stop) -> range object >> >> range(start, stop[, step]) -> range object > > With python 2.7, when I type help(range), I get > > """ > Help on built-in function range in module __builtin__: > > range(...) > range([start,] stop[, step]) -> list of integers > > Return a list containing an arithmetic progression of integers. > range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0. > When step is given, it specifies the increment (or decrement). > For example, range(4) returns [0, 1, 2, 3]. The end point is omitted! > These are exactly the valid indices for a list of 4 elements. > """ > > range([start,] stop[, step]) tells you how to call the range function, there's a start, stop and step argument. > The purpose of these arguments are given by the longer description. > > brackets [] means that the argument is optional. > > Though there's nothing wrong with googling the function for help, I'm doing it all the time. > Actually, the python documentation is a better place to get help on a particular function, just make sure you hit the correct version, for either python 2 or 3: > > https://docs.python.org/2/library/functions.html#range > > I'm using python's help function only when working offline. > > JM > There is an issue on the bug tracker about the difference between help for range between Python 2 and 3, see http://bugs.python.org/issue22785 -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Understanding "help" command description syntax - explanation needed Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-05 12:04 +0000
csiph-web