学习笔记(20):Python 面试100讲(基于Python3.x)-元类(metaclass)的作用是什么,请举例说明...

立即学习:https://edu.csdn.net/course/play/26755/340164?utm_source=blogtoedu       一、元类: 普通的类其实是由“元类”创建的。 元类可以用来实现单例模式。 其他实现单例模式的方法: http://www.javashuo.com/article/p-caeqmcmh-y.html   二、 hasattr,setattr,g
相关文章
相关标签/搜索