python如何实现一个类似重载的功能

mac2022-06-30  45

def post(): print("this is post") print("想不到吧") class Http(): @classmethod def get(self): print("this is get") def main(): Http.get=post if __name__ == '__main__': main() Http.get()

转载于:https://www.cnblogs.com/c-x-a/p/10918217.html

最新回复(0)