total idiot question: +=, .=, etc...
Neel Krishnaswami
Neel.Krishnaswami at p98.f112.n480.z2.fidonet.org
Thu Jul 1 13:06:15 EDT 1999
More information about the Python-list mailing list
Thu Jul 1 13:06:15 EDT 1999
- Previous message (by thread): total idiot question: +=, .=, etc...
- Next message (by thread): total idiot question: +=, .=, etc...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: neelk at brick.cswv.com (Neel Krishnaswami) In article <000d01bec11f$8f966e20$e19e2299 at tim>, Tim Peters <tim_one at email.msn.com> wrote: >[Neel Krishnaswami] > >> With the clear way of writing it, the NewArticle class would >> mysteriously fail to do the right thing, because the __cmp__ method >> would look in the Article class dictionary without bothering to check >> NewArticle's. > >The trap is hard to avoid, though: if a direct instance of Article is >"self", and a direct instance of NewArticle is "other", even keying off >self.__class__.etc is a surprise (well, at least to "other"!). In part >you're taking a single-dispatch approach to a problem with multiple-dispatch >headaches. <light dawns> Of course! I had noticed I wasn't having this problem in Dylan, and it somehow failed to occur to me that the only significant difference between Dylan and Python (Dylan's multiple-dispatch object model) might have something to do with it. :) Neel
- Previous message (by thread): total idiot question: +=, .=, etc...
- Next message (by thread): total idiot question: +=, .=, etc...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list