Message206367
| Author |
ethan.furman |
| Recipients |
Arfrever, eric.smith, ethan.furman, gvanrossum, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, skrah, vstinner |
| Date |
2013年12月16日.20:48:46 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1387226926.53.0.777939040208.issue19995@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Antoine Pitrou opined:
----------------------
> I'm with Guido: it doesn't really make sense to allow __index__ but not __int__ on
> a type. So trying __index__ in str.format() sounds like a distraction.
--> hex(3.14) # calls __index__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'float' object cannot be interpreted as an integer
--> '%x' % 3.14 # calls __int__
'3'
One of those behaviours is wrong. Which? |
|