__rcall__???

David C. Ullrich ullrich at math.okstate.edu
Mon Dec 20 13:26:00 EST 1999


Tres Seaver wrote:

> In article <002101bf4a98$01eda860$922d153f at tim>,
> Tim Peters <tim_one at email.msn.com> wrote:
> >[David C. Ullrich]
> >>     So why isn't there a magic __rcall__, that would go with
> >> __call__ like the other __rop__'s go with __op__?
> >>
> >>     It seems useful to me to allow x to alter the way f behaves
> >> when you call f(x); ...
> >
> >Probably for the same reason there's no __rgetitem__ for the benefit of the
> >millions of programmers who want
> >
> >    x[i]
> >
> >to use x as an index into sequence i <wink>.  That is, AFAIK nobody ever
> >asked for it before, and it's not screamingly natural (you're not really
> >*surprised* at the lack of __rcall__, right?).
>
> Smells like Visitor/multimethods/DoubleDispatch to me, and it _is_ a vacuum
> which people code around, in most languages except Lisp and its progenty;
> David is apparently the first to propose this particular solution
> (quite Pythonic, it seems to me,

    I got an email saying something about "Visitor methods". I won't ask what
that is, I'll look it up somewhere. (I didn't think that I was the first person
in the universe to wonder about this, but I don't know any of that programming
stuff. In my implementation the concept is "ettiquette":  Data and Function
both descend from Nice. Nice objects are very careful about stepping on
other objects' toes - everyone else has a veto power.)

> only adding slots to the jump
> table is not likely to win wide support).

    Wasn't actually saying that it should be added to the langauge,
mainly wanted to make certain that it wasn't already there.

> >better-hope-for-santa-to-do-it-cuz-i-doubt-guido-will-ly y'rs  - tim
>
> Looking-hopefully-for-sinterklaas'ly,
>
> Tres.
> --
> ---------------------------------------------------------------
> Tres Seaver           tseaver at palladion.com       713-523-6582
> Palladion Software    http://www.palladion.com

    Wondering-whether-you-guys-find-your-'-'-keys-wear-out-first,

um, I mean

    Wondering-whether-you-guys-find-your-'-'-keys-wear-out-first'ly,

DU




More information about the Python-list mailing list