[IronPython] No ToString?

Dan Eloff dan.eloff at gmail.com
Mon May 5 12:58:05 CEST 2008


A dictionary has an integer value, it goes into third party code, at
which point the dictionary very likely goes through some kind of copy
so that modifications to it will not affect the original.

Before going into thrid party code, d[key].ToString() works, but on
the copied dictionary, newd[key].ToString() raises:

AttributeError: 'int' object has no attribute 'ToString'

So I'm curious now, how can that happen? Before and after it seems the
value is <type 'int'>. How does int get .ToString() in the first
place, and why does it seem to be possible to lose it?

Thanks,
-Dan



More information about the Ironpython-users mailing list