Message242254
if the same class name is used within a module, but defined in different contexts (either class in class or class in function), inspect.getsourcelines() on the class object ignores the object context and only returns the first matched name.
reproduce:
a.py
----
class A(object):
class B(object):
pass
class C(object):
class B(object):
pass
------------------
>>> import inspect
>>> import a
>>> inspect.getsourcelines(a.C.B)
([' class B(object):\n', ' pass\n'], 2) |
|
Date |
User |
Action |
Args |
2015-04-29 23:04:32 | siming85 | set | recipients:
+ siming85 |
2015-04-29 23:04:32 | siming85 | set | messageid: <1430348672.59.0.934013457033.issue24078@psf.upfronthosting.co.za> |
2015-04-29 23:04:32 | siming85 | link | issue24078 messages |
2015-04-29 23:04:32 | siming85 | create | |
|