Astan Chee wrote: > I just tried to do > eval('00052') and it returned 42. > Is this a known bug in the eval function? Or have I missed the way eval > function works?
String literals beginning with a 0 are in octal. Besides, using eval for such a narrow case is extremely unwise. Instead use int: >>> int('00052') 52 -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis God grant me to contend with those that understand me. -- Thomas Fuller -- http://mail.python.org/mailman/listinfo/python-list