###特殊创建类

# class Foo (object):
# def __init__(self,name):
# self.name = name
#
# C = Foo("Caicai")
# print(type(C))


###特殊创建类
def func(self):
print("Hello %s you and %s"%(self.name,self.age))

def __init__(self,name,age):
self.name = name
self.age = age

Foo = type("Foo",(),{"func":func,"__init__":__init__})
foo = Foo("Caicai","22")
foo.func()
print(type(Foo))


posted @ 2018-05-03 12:39  Caionk  阅读(120)  评论(0编辑  收藏  举报