[Tutor] 3 simple, pithy and short questions (fwd)
op73418 at mail.telepac.pt
Fri Nov 21 19:49:04 EST 2003
On Fri, 21 Nov 2003 16:32:22 -0800 (PST), you wrote:
>> In recent years, the __str__() method was added to numbers to make them
>> more uniform with the other Python types and classes.
>Yikes, I'm totally wrong here! Numbers still don't have __str__(). I
>should have double checked my assertions about this. So we can call str()
>on numbers, but not __str__(). I misremembered the extent to which the
>numbers were unified with the other types.
<slot wrapper '__str__' of 'int' objects>
<method-wrapper object at 0x011C3A70>
Tested in 2.3.
With my best regards,
More information about the Tutor