Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80262 > unrolled thread

Re: Understanding "help" command description syntax - explanation needed

Started byChris Angelico <rosuav@gmail.com>
First post2014-11-05 23:16 +1100
Last post2014-11-05 23:16 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Understanding "help" command description syntax - explanation needed Chris Angelico <rosuav@gmail.com> - 2014-11-05 23:16 +1100

#80262 — Re: Understanding "help" command description syntax - explanation needed

FromChris Angelico <rosuav@gmail.com>
Date2014-11-05 23:16 +1100
SubjectRe: Understanding "help" command description syntax - explanation needed
Message-ID<mailman.15491.1415189785.18130.python-list@python.org>
On Wed, Nov 5, 2014 at 10:00 PM, Ivan Evstegneev
<webmailgroups@gmail.com> wrote:
> range(start, stop[, step]) -> range object
>
> For instance, how do I need to understand that (start,stop[,step])  it’s
> just a three numbers?
>
> What do those brackets--> [,] mean?

The docs for range() in Python 3 do need improvement, as Mark said,
although there's a bit more info than you see there. The exact text
varies from one version to another, but underneath that first line
should be something like:

"Return a virtual sequence of numbers from start to stop by step."

That should tell you a bit more, at least.

As to the brackets, they're a common convention meaning "optional".
This is much bigger than Python, so it's not actually explained
anywhere. (I've no idea where someone would go to try to find info on
these sorts of conventions. It's a little hard to do a Google search
for symbols and their usages. But that's what mailing lists like this
are for.) You can create a range object with two arguments (start and
stop) or three (start, stop, and step). When an argument is optional,
it usually has a default, and in this case, the default step is 1 -
every integer will be included.

Don't be afraid to ask questions. There are plenty of people here who
know both Python and C (I'm one of them), and we're happy to help out.
And hey, you might find you can contribute a better piece of help text
for something, and then we can make it better for every future
wonderer :)

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web