Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.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; 'python,': 0.01; 'python.': 0.04; 'method,': 0.07; 'received:verizon.net': 0.07; 'something,': 0.07; 'suggesting': 0.07; 'terry': 0.07; 'python': 0.08; 'object?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'argument': 0.15; 'paradigm': 0.16; 'reedy': 0.16; 'subject:OOP': 0.16; 'wrote:': 0.16; 'language,': 0.17; 'functions,': 0.18; 'jan': 0.19; 'programming': 0.20; 'seems': 0.20; 'header:In-Reply-To:1': 0.22; 'somehow': 0.23; 'suggests': 0.23; 'pm,': 0.24; 'object,': 0.24; 'creating': 0.25; 'function': 0.27; 'classes': 0.28; 'attach': 0.28; 'described': 0.28; 'arguments.': 0.30; 'object.': 0.30; 'url:03': 0.30; 'yes.': 0.30; 'class': 0.30; 'functional': 0.31; 'objects': 0.32; 'too': 0.33; 'to:addr:python-list': 0.33; 'someone': 0.34; 'header:User-Agent:1': 0.34; 'right,': 0.34; 'things': 0.34; 'header:X-Complaints-To:1': 0.35; 'object': 0.35; 'using': 0.37; 'received:org': 0.38; 'steven': 0.38; 'some': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'header:Mime-Version:1': 0.39; 'missing': 0.39; 'to:addr:python.org': 0.39; 'sense': 0.39; 'believe': 0.65; 'taking': 0.66; 'william': 0.68; 'research,': 0.82; '12:25': 0.84; 'ours,': 0.84; 'something.': 0.84; 'imperative': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Functions vs OOP Date: Sat, 03 Sep 2011 15:15:28 -0400 References: <4e625508$0$29973$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 In-Reply-To: <4e625508$0$29973$c3e8da3$5496439d@news.astraweb.com> 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1315077390 news.xs4all.nl 2489 [2001:888:2000:d::a6]:43405 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12717 On 9/3/2011 12:25 PM, Steven D'Aprano wrote: > William Gill wrote: > >> During some recent research, and re-familiarization with Python, I came >> across documentation Ours, or someone else's? >> that suggests that programming using functions, and >> programming using objects were somehow opposing techniques. >> >> It seems to me that they are complimentary. It makes sense to create >> objects and have some functions that take those objects as arguments. > > Python is a mixed paradigm language, with object, functional and imperative > paradigms. > >> Are they suggesting that any function that takes an object as an >> argument should always be a method of that object? Or of the class of the object. > Yes. > http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html Since in Python, everything is an object, that would mean that every function has to be a method, which would mean creating classes just to have a class to attach functions to. How awful. (Oh, right, I believe I just described Java.) >> Am I missing something, or am I taking things too literally? > > No, it is the OO purists who are missing something. Yes, Python. -- Terry Jan Reedy