#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'MFC'
__time__ = '2019-06-26 17:21'

"""
type()传入3个参数时，用来创建一个类
"""

ClassVariable = type('ClassA', (object,), dict(name="type test"))
a = ClassVariable()
print(type(a))
print(a.name)

class ClassB:
    name = "type test"

b = ClassB()
print(type(b))
print(b.name)
f6167c5b3d8faa129b2b3dc72d7deeb6dd4c32a2
<mask token>


class ClassB:
    <mask token>


<mask token>

<mask token>


class ClassB:
    name = 'type test'


<mask token>

<mask token>
print(type(a))
print(a.name)


class ClassB:
    name = 'type test'


<mask token>
print(type(b))
print(b.name)

__author__ = 'MFC'
__time__ = '2019-06-26 17:21'
<mask token>
ClassVariable = type('ClassA', (object,), dict(name='type test'))
a = ClassVariable()
print(type(a))
print(a.name)


class ClassB:
    name = 'type test'


b = ClassB()
print(type(b))
print(b.name)

#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'MFC'
__time__ = '2019-06-26 17:21'

"""
type()传入3个参数时，用来创建一个类
"""

ClassVariable = type('ClassA', (object,), dict(name="type test"))
a = ClassVariable()
print(type(a))
print(a.name)

class ClassB:
    name = "type test"

b = ClassB()
print(type(b))
print(b.name)