eval('000052') = 42?

John Machin sjmachin at lexicon.net
Wed Feb 21 00:37:25 EST 2007


On Feb 21, 3:09 pm, Astan Chee <s... at al.com.au> wrote:
> Hi,
> 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?
> Thanks

Eight fives are forty. Forty plus two is forty two. I see no bug here,
only a language design strangeness which can be blamed on the then-
pervasive influence of all things from Bell Labs :-)

BTW, hasn't anyone told you not to play with the eval function? Put it
down. You could catch something nasty.




More information about the Python-list mailing list