Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'from:addr:yahoo.co.uk': 0.04; '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; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:command': 0.09; 'python': 0.11; 'bug': 0.12; 'language.': 0.14; '...,': 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; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject: \n ': 0.16; 'subject:description': 0.16; 'language': 0.16; 'wrote:': 0.18; 'module': 0.19; "python's": 0.19; 'command': 0.22; 'header:User- Agent:1': 0.23; 'specifies': 0.24; 'tells': 0.24; '(or': 0.24; 'question': 0.24; 'tracker': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'correct': 0.29; 'url:bugs': 0.29; '----': 0.29; 'start,': 0.30; "i'm": 0.30; 'url:python': 0.33; '-----': 0.33; 'there': 0.35; '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; 'subject:needed': 0.38; 'url:library': 0.38; 'version,': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'subject:': 0.39; 'help,': 0.39; 'subject:" ': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'range': 0.61; 'our': 0.64; 'email name:python-list': 0.65; 'here': 0.66; 'between': 0.67; 'containing': 0.69; 'actually,': 0.84; 'offline.': 0.84; 'received:btcentralplus.com': 0.84; 'received:86': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Understanding "help" command description syntax - explanation needed Date: Wed, 05 Nov 2014 12:04:01 +0000 References: <000001cff8e7$af51ef30$0df5cd90$@gmail.com> <88543346.5460.1415188500802.JavaMail.root@sequans.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host86-178-21-119.range86-178.btcentralplus.com User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <88543346.5460.1415188500802.JavaMail.root@sequans.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1415189062 news.xs4all.nl 2881 [2001:888:2000:d::a6]:37647 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80260 On 05/11/2014 11:55, Jean-Michel Pichavant wrote: > ---- Original Message ----- >> From: "Ivan Evstegneev" >> 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