When does coerce get automagically called ?

Steven D. Majewski (sdm7g@elvis.med.Virginia.EDU)
Fri, 1 Apr 1994 15:59:03 GMT

When does coerce() [ or obj.__coerce__() ] get called
automagically? Does this only occur for numbers, or
for other objects. For what operations ?

I know it DOESN'T get called on '*' - to allow
"tablevel=2; [ ... ] print '\t' * tablevel + string
I say a note in the Ref.man that '+' also doesn't
coerce, although I don't catch the reason for that case.

And: are the numeric cases actually handled by coerce(), or
is that something that the builtin methods handle by special
casing numeric types.

[ Time for me to dig out the rational number classes and
see how they are handled there. But:
Firstly, you must find... another shrubbery! ]

BTW: Thanks to whomever posted the Holy Grail script.
The consensus of several of us was that: the problem
with all of the Monty Python postings to this group
wasn't so much their lack of *comp.lang.python* content,
as, except for the reply to "How do you single step a
Python" , they were so totally lacking in any *humor*
content! ( Well, there was *one* other good one since
then: "I think I've wet my compiler." ! )

I think I hear Tim, praying: "Please - no more poems!!!"

- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
- UVA Department of Molecular Physiology and Biological Physics