Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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; 'explicitly': 0.05; 'importing': 0.05; 'subject:Python': 0.06; 'class,': 0.07; 'explicit': 0.07; 'builtin': 0.09; 'function,': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'called.': 0.16; 'class),': 0.16; 'context:': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'notation': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'run:': 0.16; 'simpson': 0.16; 'skip:> 20': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'class.': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'globally': 0.31; 'such.': 0.31; 'them?': 0.31; 'class': 0.32; 'subject:the': 0.34; 'equal': 0.35; 'module.': 0.36; 'skip:> 10': 0.36; 'method': 0.36; 'charset:us-ascii': 0.36; 'list': 0.37; 'called': 0.40; 'how': 0.40; 'even': 0.60; 'content- disposition:inline': 0.62; 'name': 0.63; 'received:192.168.15': 0.84; 'whereas': 0.91 Date: Mon, 26 May 2014 12:36:58 +1000 From: Cameron Simpson To: Deb Wyatt Subject: Re: confused about the different built-in functions in Python MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <648E6136A80.00000651codemonkey@inbox.com> User-Agent: Mutt/1.5.21 (2010-09-15) References: <648E6136A80.00000651codemonkey@inbox.com> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401071834 news.xs4all.nl 2838 [2001:888:2000:d::a6]:48210 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72045 On 25May2014 15:55, Deb Wyatt wrote: >I am confused about how various built-in functions are called. Some are >called with dot notation > >each_item.isalpha() > >and some are called like 'normal' > >sum(numlist) > >How do you know/remember which way to call them? Documentation. However, some context: each_item.isalpha() is not a builtin function as such. It is a method of the "str" class. Whereas "sum" _is_ a builtin function, a globally known name which can be accessed and used without explicitly importing any module. There's an explicit list of the builtin functions in the Python doco. For a class, you can look at the doco for the class ("String methods" in the python doco, for the "str" class), or run: help(str) at the interactive Python prompt. Cheers, Cameron Simpson Steinbach's Law: 2 is not equal to 3 -- even for large values of 2.