Re: How to get a unique function name for methods

2009-10-29 Thread Terry Reedy
Christian Heimes wrote: Philip Guo wrote: Does anyone know how to get this information either from a code object or from a related object? I am hacking the interpreter, so I have full access to everything. Does this help? class A(object): ... def method(self): ... pass ... A.m

Re: How to get a unique function name for methods

2009-10-29 Thread Terry Reedy
Philip Guo wrote: Hi all, This is my first post, so sorry for the n00bish question. Let's say I have 2 classes with the same __init__ method defined in a file foo.py: class A: def __init__(self): pass class B: def __init__(self): pass For the purpose of a code analysis, I need

Re: How to get a unique function name for methods

2009-10-29 Thread Christian Heimes
Philip Guo wrote: > Does anyone know how to get this information either from a code object or > from a related object? I am hacking the interpreter, so I have full access > to everything. Does this help? >>> class A(object): ... def method(self): ... pass ... >>> A.method.im_class >

How to get a unique function name for methods

2009-10-29 Thread Philip Guo
Hi all, This is my first post, so sorry for the n00bish question. Let's say I have 2 classes with the same __init__ method defined in a file foo.py: class A: def __init__(self): pass class B: def __init__(self): pass For the purpose of a code analysis, I need to get a UNIQUE name f