[Pythonmac-SIG] string index bug?

Keith Nemitz keithn at 2xtreme.net
Fri Jan 30 21:25:04 EST 2004


This one's so unbelievable, I'd rather be ridiculed for not 
understanding TFM than let a potential bug slip. I'm running macPython 
2.3 on Panther.

Drop into python from Terminal. Type

 >>>print "food"[-3:-1]
oo

 >>>print "food"[-3:0]

(results in an empty line)


huh? I mean does everyone use[-3:] instead and 0 is taboo? I'm used to 
the Icon programming language where "food"[-3:0] returns --> ood


Keith Nemitz




More information about the Pythonmac-SIG mailing list