Message195451
| Author |
arigo |
| Recipients |
arigo, mark.dickinson, serhiy.storchaka, zach.ware |
| Date |
2013年08月17日.07:55:01 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1376726101.58.0.364501057625.issue18712@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Just mentioning it here again, but "type(a).__index__(a)" is still not perfectly correct. Attached is a case where it differs.
I think you get always the correct answer by evaluating "range(a).stop". It's admittedly obscure... For example:
class A:
def __index__(self):
return -42**100
a = A()
print(range(a).stop) |
|