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


Groups > comp.lang.python > #43757

Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <antoon.pardon@rece.vub.ac.be>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'motivated': 0.05; 'received:134': 0.05; 'see.': 0.07; 'builtin': 0.09; 'classes.': 0.09; 'here?': 0.09; 'interpreted': 0.09; 'patch.': 0.09; 'tests,': 0.09; 'python': 0.11; 'jan': 0.12; '"object': 0.16; 'bool': 0.16; 'pity': 0.16; 'reedy': 0.16; 'slice,': 0.16; 'subject: \n ': 0.16; 'subject:OOP': 0.16; 'subject:object': 0.16; 'subject:possible': 0.16; 'subject:programming': 0.16; 'subject:type': 0.16; 'throw': 0.16; 'usable': 0.16; 'wrote:': 0.18; 'typing': 0.19; 'seems': 0.21; '>>>': 0.22; 'header:User- Agent:1': 0.23; 'case.': 0.24; 'subject:/': 0.26; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'leave': 0.29; 'am,': 0.29; 'patch': 0.29; "doesn't": 0.30; 'class': 0.32; 'lists': 0.32; 'something': 0.35; 'one,': 0.35; 'but': 0.35; 'there': 0.35; 'combination': 0.36; 'instances': 0.36; 'should': 0.36; 'two': 0.37; 'list.': 0.37; 'being': 0.38; 'stopped': 0.38; 'to:addr :python-list': 0.38; 'list,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'liked': 0.60; 'matter': 0.61; 'skip:n 10': 0.64; 'decided': 0.64; 'subject:The': 0.64; 'great': 0.65; 'effectively': 0.66; 'here': 0.66; 'believe': 0.68; 'feeling': 0.68; 'other.': 0.75; '"index"': 0.84; 'experiment': 0.84; 'pardon': 0.84; 'involved.': 0.91; 'killed': 0.91; 'thoroughly': 0.91
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result Ap8EAFaPblGGuA9G/2dsb2JhbABQwWqCXoEbgxMBAQQBeBELGAkWDwkDAgECAUUTCAKICga0MIkRiXeFKhaDMAOXBoV0iyCBVYE4
Date Wed, 17 Apr 2013 14:04:48 +0200
From Antoon Pardon <antoon.pardon@rece.vub.ac.be>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12
MIME-Version 1.0
To python-list@python.org
Subject Re: The type/object distinction and possible synthesis of OOP and imperative programming languages
References <mailman.618.1365997692.3114.python-list@python.org> <516bd241$0$29872$c3e8da3$5496439d@news.astraweb.com> <516C3C44.6010706@rece.vub.ac.be> <mailman.651.1366073708.3114.python-list@python.org> <516cb85b$0$29977$c3e8da3$5496439d@news.astraweb.com> <kkifse$60e$1@ger.gmane.org> <516D14DA.5090406@rece.vub.ac.be> <kkjvdq$rtv$1@ger.gmane.org>
In-Reply-To <kkjvdq$rtv$1@ger.gmane.org>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.722.1366200301.3114.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1366200301 news.xs4all.nl 2611 [2001:888:2000:d::a6]:59746
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:43757

Show key headers only | View raw


Op 16-04-13 18:49, Terry Jan Reedy schreef:
> On 4/16/2013 5:07 AM, Antoon Pardon wrote:
>> Op 16-04-13 05:17, Terry Jan Reedy schreef:
>>
>>> I will keep the above in mind if I write or review a patch. here are 4
>>> non-subclassable builtin classes. Two are already documented. Bool in
>>> one, forget which other. I believe it was recently decided to leave
>>> the other two as is given the absence of any practical use case.
>>
>> Why should there be a practical use case here?
>
> As a practical matter, the change is non-trivial. Someone has to be
> motivated to write the patch to enable subclassing, write tests, and
> consider the effect on internal C uses of slice and stdlib Python used
> of slice (type() versus isinstance).
I see. It seems I have underestimated the work involved.

>> I once had an idea of a slice-like class that I would have liked to
>> experiment with.
>
> Did the idea actually require that instances *be* a slice rather than
> *wrap* a slice? 

As far as I remember I wanted my slice object usable to slice lists
with. But python doesn't allow duck typing when you use your object to
"index" a list. No matter how much your object resembles a slice, when
you actualy try to use it to get a slice of a list, python throw a
TypeError with the message "object cannot be interpreted as an index".
This in combination with slice not being subclassable effectively killed
the idea.

As I already said I don't know if the idea would have turned up
something usefull. The following years I never had the feeling how great
it would have been should I have been able to pursue this idea. I just
thought it was a pity I was so thoroughly stopped at the time.

-- 
Antoon Pardon

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


Thread

The type/object distinction and possible synthesis of OOP and imperative programming languages Mark Janssen <dreamingforward@gmail.com> - 2013-04-14 20:48 -0700
  Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-15 10:11 +0000
    Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-04-15 19:43 +0200
      Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-16 02:15 +0000
    Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Dave Angel <davea@davea.name> - 2013-04-15 17:13 -0400
      Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Rotwang <sg552@hotmail.co.uk> - 2013-04-15 23:12 +0100
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Chris Angelico <rosuav@gmail.com> - 2013-04-16 08:32 +1000
          Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Rotwang <sg552@hotmail.co.uk> - 2013-04-15 23:54 +0100
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Mark Janssen <dreamingforward@gmail.com> - 2013-04-16 15:38 -0700
          Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-17 06:40 +0000
            Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Chris Angelico <rosuav@gmail.com> - 2013-04-17 16:56 +1000
            Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Chris Rebert <clp2@rebertia.com> - 2013-04-17 00:16 -0700
            Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-04-17 18:40 -0400
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-16 17:14 -0600
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Michael Torrie <torriem@gmail.com> - 2013-04-18 10:37 -0600
          Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Neil Cerutti <neilc@norwich.edu> - 2013-04-18 17:57 +0000
          Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-19 01:00 +0000
            Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Roy Smith <roy@panix.com> - 2013-04-18 21:08 -0400
              Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Mark Janssen <dreamingforward@gmail.com> - 2013-04-18 18:24 -0700
              Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Ned Batchelder <ned@nedbatchelder.com> - 2013-04-18 22:10 -0400
              Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Mark Janssen <dreamingforward@gmail.com> - 2013-04-18 19:30 -0700
                Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-19 03:38 +0000
              Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Ned Batchelder <ned@nedbatchelder.com> - 2013-04-18 22:39 -0400
              Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Mark Janssen <dreamingforward@gmail.com> - 2013-05-01 13:32 -0700
                Re: The type/object distinction and possible synthesis of OOP and imperative programming languages alex23 <wuwei23@gmail.com> - 2013-05-01 18:13 -0700
    Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Terry Jan Reedy <tjreedy@udel.edu> - 2013-04-15 20:52 -0400
      Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-16 02:32 +0000
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Terry Jan Reedy <tjreedy@udel.edu> - 2013-04-15 23:17 -0400
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-15 22:46 -0600
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages rusi <rustompmody@gmail.com> - 2013-04-15 21:56 -0700
          Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-16 05:59 +0000
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Serhiy Storchaka <storchaka@gmail.com> - 2013-04-16 11:25 +0300
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-04-16 11:07 +0200
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Terry Jan Reedy <tjreedy@udel.edu> - 2013-04-16 12:49 -0400
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Ethan Furman <ethan@stoneleaf.us> - 2013-04-16 10:29 -0700
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Terry Jan Reedy <tjreedy@udel.edu> - 2013-04-16 14:29 -0400
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-16 12:22 -0600
        Re: The type/object distinction and possible synthesis of OOP and imperative programming languages Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-04-17 14:04 +0200
  Re: The type/object distinction and possible synthesis of OOP and imperative programming languages 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-15 23:54 -0700
  Re: The type/object distinction and possible synthesis of OOP and imperative programming languages 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-15 23:54 -0700
  Re: The type/object distinction and possible synthesis of OOP and imperative programming languages rusi <rustompmody@gmail.com> - 2013-04-21 08:44 -0700

csiph-web