__rcall__???
David C. Ullrich
ullrich at math.okstate.edu
Mon Dec 20 13:09:21 EST 1999
Tim Peters 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>.
Yeah, I was gonna ask about that (haha).
> 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?).
No, it doesn't seem screamingly natural, and I'm not really surprised
at the lack of it. Well, it doesn't seem so natural in most contexts; it
actually does seem fairly natural (and it _is_ very useful, putting-each
-bit-of-code-where-it-belongs-wise) in this thing I'm doing.
But I wasn't actually expecting anyone to add it to Python for me,
I just thought I'd ask (mainly because the other day when I asked about
Transpose it turned out that there _was_ a Transpose built in, just
spelled funny. Coulda been there _was_ a misspelled __rcall__
already there as well. I gather not.)
What's the story on __rpow__, natural-wise? I have a book that
lists all the magic methods but leaves out __rpow__. Was that
just an omission in the book, or did __rpow__ get added some time
after version 1.3 (the version in the book)?
If the latter, I'd like to say that when I saw no __rpow__ in the
book I decided I couldn't do what I was trying to do that day (I've
got my own clumsy __rcall__ working but I don't know how
I'd do __rpow__ by hand the same way) - when I found __rpow__
in the docs I decided that project was doable. It seems clear that
there's no need for an __rpow__, but I've used it several times.
> better-hope-for-santa-to-do-it-cuz-i-doubt-guido-will-ly y'rs - tim
Thanks. Of course today is already Dec. 20 (hehe, I bet actually
I _will_ be able to find a few North Pole URL's if I look...)
More information about the Python-list
mailing list