标签:soc rom return pat from 补丁 patch def sock
看代码
import socket print(socket.socket) print("After monkey patch") from gevent import monkey monkey.patch_socket() print(socket.socket()) import select print(select.select) monkey.patch_select() print("After monkey patch") print(select.select) import time print(time.time()) def _time(): return 1234 time.time = _time print(time.time()) # 这样就实现了运行替换,所谓的monkey patch
标签:soc rom return pat from 补丁 patch def sock
原文地址:https://www.cnblogs.com/dairuiquan/p/11444202.html