Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'argument': 0.05; 'plenty': 0.07; 'subject:help': 0.08; 'arguments': 0.09; 'conventions.': 0.09; 'subject:command': 0.09; 'cc:addr:python-list': 0.11; 'contribute': 0.11; 'python': 0.11; "(i'm": 0.16; '(start,': 0.16; '10:00': 0.16; 'brackets,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ivan': 0.16; 'least.': 0.16; 'sorts': 0.16; 'stop)': 0.16; 'subject:description': 0.16; 'symbols': 0.16; 'varies': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'integer': 0.24; 'cc:2**0': 0.24; 'header :In-Reply-To:1': 0.27; 'idea': 0.28; 'bigger': 0.30; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; 'usually': 0.31; 'default,': 0.31; 'explained': 0.31; 'piece': 0.31; 'lists': 0.32; 'there.': 0.32; "we're": 0.32; 'text': 0.33; 'info': 0.35; 'common': 0.35; 'something': 0.35; 'case,': 0.35; 'more,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'version': 0.36; 'sequence': 0.36; 'should': 0.36; 'virtual': 0.37; 'two': 0.37; 'step': 0.37; 'convention': 0.38; 'nov': 0.38; 'subject:needed': 0.38; 'pm,': 0.38; 'little': 0.38; 'subject:" ': 0.39; 'mailing': 0.39; 'how': 0.40; 'future': 0.60; 'tell': 0.60; 'numbers': 0.61; 'range': 0.61; 'first': 0.61; 'more': 0.64; 'afraid': 0.65; 'here': 0.66; 'default': 0.69; 'hey,': 0.75; 'improvement,': 0.84; 'it\xe2\x80\x99s': 0.84; 'stop,': 0.84; 'underneath': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=ryptmZlPzWO/4m0u5E8FIF19rI1Weg1cfDlfmlBrBW4=; b=hKQl668BKkbgXVUZx8AevKUSSApBh2PqlehwSu3tYEIGtdCmniw1OCyo6CvtxjNWYd M6APfahWeRwENtwHSHm+sTDfigJcbk+28GjtfbMJsMVTMp8DfFtR3tDMFi2KGpHmZZS1 pnEiNijiS/owXpVCUbv0Bf1O71rE7MgXAsOTC35trU70ifynPJ77Qv6mogudYxypp/k+ WWQfATzYcsI4dBJ8XqftBXgdeRj42fR7KwjGvGx+qAtRv/EOXc7RNekiKR4usdkSMai/ bC52iZ0n4eL3w25dcNdAdnOL2hsLym4YxrkzR4slgFPuaRjcp1h6U34yfNfv/sSTx+Rp YLSg== MIME-Version: 1.0 X-Received: by 10.50.128.35 with SMTP id nl3mr4455335igb.34.1415189776498; Wed, 05 Nov 2014 04:16:16 -0800 (PST) In-Reply-To: <000001cff8e7$af51ef30$0df5cd90$@gmail.com> References: <000001cff8e7$af51ef30$0df5cd90$@gmail.com> Date: Wed, 5 Nov 2014 23:16:16 +1100 Subject: Re: Understanding "help" command description syntax - explanation needed From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1415189785 news.xs4all.nl 2848 [2001:888:2000:d::a6]:43286 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:80262 On Wed, Nov 5, 2014 at 10:00 PM, Ivan Evstegneev wrote: > range(start, stop[, step]) -> range object > > For instance, how do I need to understand that (start,stop[,step]) it=E2= =80=99s > 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