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


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

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

Started by"Ivan Evstegneev" <webmailgroups@gmail.com>
First post2014-11-05 14:31 +0200
Last post2014-11-05 14:31 +0200
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 "Ivan Evstegneev" <webmailgroups@gmail.com> - 2014-11-05 14:31 +0200

#80267 — RE: Understanding "help" command description syntax - explanation needed

From"Ivan Evstegneev" <webmailgroups@gmail.com>
Date2014-11-05 14:31 +0200
SubjectRE: Understanding "help" command description syntax - explanation needed
Message-ID<mailman.15496.1415190761.18130.python-list@python.org>
Chris,

You got my point exactly. ^_^ This is not about a "range" command itself, but those conventions.
Thanks.

Larry,

>> That's what I'm talking about (asking actually), where do you know it from?

>>I know it because I've been a programmer for 39 years.

I didn't intend to offence anyone here. Just asked a questions ^_^



-----Original Message-----
From: Python-list [mailto:python-list-bounces+webmailgroups=gmail.com@python.org] On Behalf Of Chris Angelico
Sent: Wednesday, November 5, 2014 14:16
Cc: python-list@python.org
Subject: Re: Understanding "help" command description syntax - explanation needed

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
--
https://mail.python.org/mailman/listinfo/python-list

[toc] | [standalone]


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


csiph-web