我需要制作一个套接字模块的副本才能使用它,并且需要另外一个套接字模块进行猴子修补并以不同的方式使用它.
这可能吗?
我的意思是真正复制一个模块,即在运行时获得相同的结果,就好像我已经复制socketmodule.c,将initsocket()函数更改为initmy_socket(),并将其作为my_socket扩展安装.
socketmodule.c
initsocket()
initmy_socket()
my_socket
python python-c-extension
python ×1
python-c-extension ×1