inspect.getmembers in order?

后端 未结 6 1931
栀梦
栀梦 2021-01-01 10:54
inspect.getmembers(object[, predicate])

Return all the members of an object in a list of (name, value) pairs sorted by nam

6条回答
  •  灰色年华
    2021-01-01 11:51

    In reference to Ned Batchelder's answer above, in Python 3 line numbers of a method m can be gotten with m.__func__.__code__.co_firstlineno

    inspect — Inspect live objects

提交回复
热议问题