Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:" ': 0.03; 'function,': 0.07; 'python': 0.08; 'func': 0.09; 'lambda:': 0.09; 'am,': 0.13; 'received:209.85.214.174': 0.13; 'received:mail- iw0-f174.google.com': 0.13; 'defined': 0.14; 'wrote:': 0.15; '"classic"': 0.16; 'arg2,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'function).': 0.16; 'subject:() ': 0.16; 'method.': 0.16; '>>>': 0.16; 'def': 0.16; 'subject:list': 0.16; 'subject:skip:d 10': 0.17; 'describes': 0.19; 'subject:not': 0.21; "aren't": 0.22; 'header:In-Reply-To:1': 0.22; 'here?': 0.23; 'fri,': 0.28; 'received:209.85.214': 0.28; 'message-id:@mail.gmail.com': 0.28; 'object': 0.30; 'types.': 0.30; 'class': 0.31; 'chris': 0.32; 'does': 0.32; 'to:addr:python- list': 0.34; 'functions.': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'created': 0.38; 'steven': 0.38; 'something': 0.38; 'to:addr:python.org': 0.39; 'might': 0.39; 'received:209': 0.40; 'here:': 0.64; '__call__': 0.84; 'subject:should': 0.84; 'subject:place': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=w7gAc43RQC2I49Ys/XAO7SmdybFFGKyNcz+DYNtexcA=; b=LUiuoOH1gy4mePhTrpGceZ1D8roSZMVcyXgbGOnD2AoGBuZYvSN3tmt37jc8wMawOF K80Ks1/O2Rsbam5d+Ii2/0O9BCIyiAksjKDB9+T7I5w26Us4SMC3+rUK0hOBqsrO7XGy l8YbgqRPuFGADwcKVUWcqYzRyNijhi69S3qmY= MIME-Version: 1.0 In-Reply-To: <4e1f989e$0$29990$c3e8da3$5496439d@news.astraweb.com> References: <4e1f989e$0$29990$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 15 Jul 2011 16:24:07 +1000 Subject: Re: list(), tuple() should not place at "Built-in functions" in documentation From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310711050 news.xs4all.nl 23898 [2001:888:2000:d::a6]:33960 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9509 On Fri, Jul 15, 2011 at 11:32 AM, Steven D'Aprano wrote: > Inside wrote: > >> As telling in the subject,because "list" and "tuple" aren't functions,they >> are types.Is that right? > > Yes they are types. But they can still be used as functions. Does it matter? Python is duck-typed, even in its documentation. If Python describes something as a function, it means it can be used in place of func in here: result = func(arg1, arg2, arg3) It might be something created with def (a "classic" function). It might be something created with lambda. It might be an object with a __call__ method. It might be a type. >>> class foo: def __call__(self): return lambda: print("asdf") >>> bar=foo() >>> quux=bar() >>> quux() asdf How many functions are defined here? Chris Angelico