小编Jee*_*ney的帖子

在python中查找哪个函数正在使用给定的类

我有课

class A:
 def __init__(self):
  print(i was used by :)

# if i call this class from the function below,
 
def my_func():
 a = A()

# I need class A to print that "i was used in: my_func() "
Run Code Online (Sandbox Code Playgroud)

有什么解决办法吗?

python python-2.7

2
推荐指数
1
解决办法
41
查看次数

标签 统计

python ×1

python-2.7 ×1