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


Groups > comp.lang.python > #80258

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

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=379ee7999=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'argument': 0.05; '"""': 0.07; 'defaults': 0.07; 'elements.': 0.07; 'indices': 0.07; 'wednesday,': 0.07; 'subject:help': 0.08; '[0,': 0.09; 'arguments': 0.09; 'explanation': 0.09; 'function,': 0.09; 'integers': 0.09; 'subject:command': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '...,': 0.16; 'argument.': 0.16; 'brackets': 0.16; 'given,': 0.16; 'googling': 0.16; 'increment': 0.16; 'integers.': 0.16; 'optional.': 0.16; 'progression': 0.16; 'subject: \n ': 0.16; 'subject:description': 0.16; 'module': 0.19; "python's": 0.19; 'command': 0.22; 'cc:addr:python.org': 0.22; 'specifies': 0.24; 'tells': 0.24; '(or': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'function': 0.29; 'correct': 0.29; '----': 0.29; 'start,': 0.30; "i'm": 0.30; 'url:python': 0.33; '-----': 0.33; 'doing': 0.36; 'url:org': 0.36; 'example,': 0.37; 'wrong': 0.37; 'list': 0.37; 'email addr:python.org': 0.37; 'step': 0.37; 'thank': 0.38; 'subject:needed': 0.38; 'url:library': 0.38; 'version,': 0.38; 'needed': 0.38; 'subject:': 0.39; 'help,': 0.39; 'subject:" ': 0.39; 'sure': 0.39; 'either': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'range': 0.61; 'you.': 0.62; 'information': 0.63; 'received:194': 0.64; 'email name:python- list': 0.65; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'notice:': 0.67; 'person,': 0.68; 'containing': 0.69; 'privileged.': 0.69; 'disclose': 0.74; 'actually,': 0.84; 'offline.': 0.84; 'medium.': 0.91
X-IronPort-AV E=Sophos;i="5.07,319,1413237600"; d="scan'208";a="3553937"
Date Wed, 5 Nov 2014 12:55:00 +0100 (CET)
From Jean-Michel Pichavant <jeanmichel@sequans.com>
To Ivan Evstegneev <webmailgroups@gmail.com>
In-Reply-To <000001cff8e7$af51ef30$0df5cd90$@gmail.com>
Subject Re: Understanding "help" command description syntax - explanation needed
MIME-Version 1.0
X-Mailer Zimbra 7.2.7_GA_2942 (ZimbraWebClient - GC37 (Linux)/7.2.7_GA_2942)
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15487.1415188503.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1415188503 news.xs4all.nl 2897 [2001:888:2000:d::a6]:60225
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80258

Show key headers only | View raw


---- 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



-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Understanding "help" command description syntax - explanation needed Jean-Michel Pichavant <jeanmichel@sequans.com> - 2014-11-05 12:55 +0100

csiph-web