Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'input,': 0.09; 'namespace': 0.09; 'propagate': 0.09; 'subject:while': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'sat,': 0.15; 'compile,': 0.16; 'exists?': 0.16; 'identifiers': 0.16; 'wrote:': 0.17; 'feb': 0.19; 'module': 0.19; 'bit': 0.21; 'defined': 0.22; 'cc:2**0': 0.23; '(you': 0.23; 'monday,': 0.23; 'statement': 0.23; 'this:': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'fit': 0.26; 'am,': 0.27; 'question': 0.27; 'chris': 0.28; 'oop': 0.29; 'types.': 0.29; 'array': 0.29; 'definition': 0.29; 'objects': 0.29; "i'm": 0.29; 'function': 0.30; 'sense': 0.31; 'johnson': 0.32; '11,': 0.33; 'function.': 0.33; 'knowledge': 0.33; 'languages': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'dir': 0.35; 'sequence': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'but': 0.36; "wasn't": 0.36; 'method': 0.36; 'should': 0.36; 'does': 0.37; 'why': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'where': 0.40; 'help': 0.40; 'your': 0.60; 'include:': 0.61; 'kind': 0.61; 'more': 0.63; 'decided': 0.65; 'sum': 0.66; 'capital': 0.68; 'special': 0.73; '100%': 0.76; '/only/': 0.84; '2013': 0.84; 'on?': 0.91; 'rick': 0.91; 'yes!': 0.93 X-Received: by 10.49.98.42 with SMTP id ef10mr1199753qeb.15.1360643081955; Mon, 11 Feb 2013 20:24:41 -0800 (PST) Newsgroups: comp.lang.python Date: Mon, 11 Feb 2013 20:24:41 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.196.64.201; posting-account=h3aEwQoAAACiuqX-oR3gvCVFm8lLHoWj References: <5002a1f9$0$29995$c3e8da3$5496439d@news.astraweb.com> <7b027612-a07e-40f9-8ad2-3e95c5440482@googlegroups.com> <86872ad2-fda0-403b-9f18-d1cb18e41860@t32g2000yqd.googlegroups.com> <50039290$0$29978$c3e8da3$5496439d@news.astraweb.com> <9309333c-13a0-464c-bd94-9c682363b8c9@googlegroups.com> <511516db$0$29969$c3e8da3$5496439d@news.astraweb.com> <62c3e7bb-d023-43b4-b759-f424707fd346@googlegroups.com> <75c82449-773e-4077-a6c9-e9cef08f845f@googlegroups.com> <51fdb504-9969-4bff-b1dc-32e231beecd4@googlegroups.com> <04856796-18ef-42e9-b7e9-66354475a78f@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 70.196.64.201 MIME-Version: 1.0 Subject: Re: Implicit conversion to boolean in if and while statements From: Rick Johnson To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: , Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360643090 news.xs4all.nl 6953 [2001:888:2000:d::a6]:57353 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38722 On Monday, February 11, 2013 7:52:24 AM UTC-6, Chris Angelico wrote: > [...] > But my statement wasn't based on my own knowledge of the stdlib, but > rather on this: >=20 > On Sat, Feb 9, 2013 at 6:58 AM, Rick Johnson wrote: > > I'm a bit unnerved by the sum function. Summing a > > sequence only makes sense if the sequence in question > > contains /only/ numeric types. For that reason i decided > > to create a special type for holding Numerics. >=20 > Why create a special type if it already exists? Because at the time i made this statement we were discussing 100% true OOP = (you know, the kind of paradigm where object definition identifiers start w= ith a capital letter? *estoeric-wink*), but more importantly because i don'= t find the current implementation of array and list to be consistent. > Yep. By the way, how does the help function fit into your wonderfully > OOP model? What's it a method on? Well since /all/ objects will have help available it should be defined Obje= ct#help and then propagate downwards. But even true OOP languages need a fe= w global functions... *gasp*... oh yes! A few that come to mind include: globals, locals, vars, compile, eval, exec, input, print, dir =20 And don't forget, we still have module namespace to deal with! =20 =20