Comment on draft PEP for deprecating six builtins

Duncan Booth duncan at NOSPAMrcp.co.uk
Mon Apr 29 09:33:31 EDT 2002


Roman Neuhauser <neuhauser at mail.cz> wrote in 
news:mailman.1020083690.16055.python-list at python.org:

>     __builtin__.chr(int) -> int.chr()
>     __builtin__.abs(int) -> int.abs()
>     __builtin__.ord(str) -> str.ord()
>     etc
> 

The problem with int.chr() is that a lot of people are going to get 
confused when they find that "42.chr()" doesn't work (although "42 .chr()" 
does).

42 .__abs__() already works. :-)
-42 .__abs__() also works, but again the result might surprise some people 
if they expected it to be the same as int.__abs__(-42)

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list