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; 'true,': 0.04; 'case.': 0.05; 'everybody,': 0.05; 'parameter': 0.07; 'statically': 0.07; 'subject:How': 0.09; 'defined,': 0.09; 'degree,': 0.09; 'subject:method': 0.09; 'thread,': 0.09; 'tonight.': 0.09; 'typed': 0.09; 'undefined.': 0.09; 'bug': 0.10; 'cc:addr:python- list': 0.10; 'def': 0.10; 'language,': 0.11; '*any*': 0.16; 'illegal.': 0.16; 'jumping': 0.16; 'subject:class': 0.16; 'subject:instance': 0.16; 'subject:pass': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'restrictions': 0.17; 'written': 0.20; 'all,': 0.21; 'anonymous': 0.22; 'defined': 0.22; 'cc:2**0': 0.23; 'this:': 0.23; "haven't": 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.28; 'all.': 0.28; "d'aprano": 0.29; 'enforce': 0.29; 'implied': 0.29; 'name?': 0.29; 'steven': 0.29; 'definition': 0.29; 'function': 0.30; 'operate': 0.32; 'could': 0.32; 'function.': 0.33; 'true.': 0.33; "can't": 0.34; 'nov': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'there': 0.35; 'but': 0.36; 'should': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'matter': 0.61; 'is.': 0.62; 'please,': 0.62; 'more': 0.63; 'behavior': 0.64; 'replying': 0.64; 'header:Reply-To:1': 0.68; 'person.': 0.69; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'url:2011': 0.72; 'url:wordpress': 0.75; 'enforced': 0.84; 'received:74.208.4.194': 0.84; 'articles,': 0.91; 'angel': 0.93; 'blog,': 0.93 Date: Mon, 26 Nov 2012 22:14:59 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: Steven D'Aprano Subject: Re: How to pass class instance to a method? References: <3193e3dd-0507-4ff7-9026-ee80e5d9c1dd@googlegroups.com> <50b3eab5$0$29994$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <50b3eab5$0$29994$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:7m74jdYF9u7QmLtX44gw47wUbEQKeXvqEjJKG8/W47U Eoeq0L3oW8A6nl84ST2U3WAyE+vyuyf1snIUKlc+XXT6iuONuO zlMRzkTiiKl/FGfvtZbwU2rLWplQhjkp8HrvL6uUyiY8mgirzz Gfy1wd4G6zyUCh6EhRtvMJIhYwWEJotzwW3nfRGCRmlQgBuKu3 JnjQIYKnYqPZRS8kGhdnsp/aCNE/SBjiihG9MzQQJcImtZFToX I1n3Pcp4rHu0bMvo4orZyFkQ9yOzboXrl9t4bNCiNNBb5nTFON iPslAkE+oaQxlhsSb7VDSHzjbOm0pRhz0tv8QX672dmlduejw= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353986116 news.xs4all.nl 6879 [2001:888:2000:d::a6]:57204 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:33961 On 11/26/2012 05:18 PM, Steven D'Aprano wrote: > On Mon, 26 Nov 2012 16:58:47 -0500, Dave Angel wrote: > >> In a statically typed language, the valid types >> are directly implied by the function parameter declarations, while in a >> dynamic language, they're defined in the documentation, and only >> enforced (if at all) by the body of the function. > > Well that certainly can't be true, because you can write functions > without *any* documentation at all, and hence no defined type > restrictions that could be enforced: That's backwards. Any body should be a bug in that case. It doesn't matter what you pass to a function that is unspecified, it's behavior is undefined. Calling it is inherently illegal. > > def trivial_example(x): > return x+1 > > No documentation, and so by your definition above this should be weakly > typed and operate on any type at all. Since there are no type > restrictions defined, the body cannot enforce those type restrictions. > But that's clearly not true. > > Please, everybody, before replying to this thread, please read this: > > http://cdsmith.wordpress.com/2011/01/09/an-old-article-i-wrote/ I read part of it, and it's more than I care to read tonight. It seems to be written by an anonymous person. By jumping around in his blog, I see a lot of interesting articles, but i haven't yet figured out who he is. Does he have a name? A degree, a job in computers, a reputation? -- DaveA