Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #12717

Re: Functions vs OOP

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 <python-python-list@m.gmane.org>
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 <tjreedy@udel.edu>
Subject Re: Functions vs OOP
Date Sat, 03 Sep 2011 15:15:28 -0400
References <j3tjov$c30$1@dont-email.me> <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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.746.1315077390.27778.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Functions vs OOP William Gill <noreply@domain.invalid> - 2011-09-03 12:15 -0400
  Re: Functions vs OOP Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-04 02:25 +1000
    Re: Functions vs OOP Terry Reedy <tjreedy@udel.edu> - 2011-09-03 15:15 -0400
      Re: Functions vs OOP William Gill <noreply@domain.invalid> - 2011-09-03 17:34 -0400
        Re: Functions vs OOP Ben Finney <ben+python@benfinney.id.au> - 2011-09-04 07:39 +1000
          Re: Functions vs OOP William Gill <nospam@domain.invalid> - 2011-09-03 17:58 -0400
        Re: Functions vs OOP Terry Reedy <tjreedy@udel.edu> - 2011-09-03 21:51 -0400
          Re: Functions vs OOP William Gill <noreply@domain.invalid> - 2011-09-03 22:18 -0400
    Re: Functions vs OOP William Gill <nospam@domain.invalid> - 2011-09-05 14:58 -0400
  Re: Functions vs OOP MRAB <python@mrabarnett.plus.com> - 2011-09-03 17:29 +0100
    Re: Functions vs OOP William Gill <noreply@domain.invalid> - 2011-09-03 17:09 -0400
  Re: Functions vs OOP Ian Kelly <ian.g.kelly@gmail.com> - 2011-09-03 12:50 -0600
    Re: Functions vs OOP William Gill <noreply@domain.invalid> - 2011-09-03 17:13 -0400
    Re: Functions vs OOP tinnews@isbd.co.uk - 2011-09-04 09:13 +0100
      Re: Functions vs OOP Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-04 21:18 +1000
      Re: Functions vs OOP Terry Reedy <tjreedy@udel.edu> - 2011-09-04 14:32 -0400
        Re: Functions vs OOP William Gill <nospam@domain.invalid> - 2011-09-04 15:43 -0400
          Re: Functions vs OOP Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-05 09:41 +1000
            Re: Functions vs OOP William Gill <nospam@domain.invalid> - 2011-09-04 20:46 -0400
            Re: Functions vs OOP Chris Angelico <rosuav@gmail.com> - 2011-09-05 10:59 +1000
  Re: Functions vs OOP rusi <rustompmody@gmail.com> - 2011-09-04 06:13 -0700
    Re: Functions vs OOP William Gill <noreply@domain.invalid> - 2011-09-05 13:45 -0400
      Re: Functions vs OOP Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-09-05 21:04 +0200
        Re: Functions vs OOP William Gill <nospam@domain.invalid> - 2011-09-05 20:30 -0400
      Re: Functions vs OOP Terry Reedy <tjreedy@udel.edu> - 2011-09-05 18:55 -0400

csiph-web