UnboundMethodType and MethodType
Scott David Daniels
scott.daniels at acm.org
Wed Feb 8 19:28:11 EST 2006
Kirk McDonald wrote:
> Scott David Daniels wrote: <an elaboration on ids and refcounts>
>
> You know what? That makes perfect sense. Thank you.
Thanks a lot for mentioning this. I do try to help out, and sometimes
it feels like talking to the wind. A thanks every now and then is
greatly appreciated.
Just for fun, you can play with:
import sys
sys.getrefcount(123**18)
vs.
sys.getrefcount(12)
You should know that 'small' integers are kept and shared once built.
Similarly, some strings (including all one-character strings and strings
that might be identifiers).
sys.getrefcount('a')
sys.getrefcount('probably_not_really_a_variable')
--Scott David Daniels
scott.daniels at acm.org
More information about the Python-list
mailing list