2012年12月24日

摘要: 原理:利用元类型,重新定义类实例化一个新对象的方法(__call__)行为。让其只返回同一个实例。#-*- coding: UTF-8 -*-#-------------------------------------------------------------------------------# Name: ģ��shell# Purpose: Ӧ�ó����main��ں���## Author: ankier## Created: 26-10-2012# Copyright: (c) ankier 2012# Licence: <... 阅读全文
posted @ 2012-12-24 20:41 |残阳|露 阅读(243) 评论(0) 推荐(0) 编辑
摘要: metaclass,元类metaclass是这样定义的:In object-oriented programming,a metaclass is a class whose instances are classes.Just as an ordinary class defines the behavior of certain objects,a metaclass defines the behavior of certain classes and their instances.metaclass的实例化结果是类,而class实例化的结果是instance。metaclass是创建 阅读全文
posted @ 2012-12-24 20:03 |残阳|露 阅读(331) 评论(0) 推荐(0) 编辑

导航