mirror of
https://github.com/python/cpython.git
synced 2025-10-26 16:27:06 +00:00
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
19 lines
458 B
Python
19 lines
458 B
Python
|
|
# http://python.org/sf/1303614
|
|
|
|
class Y(object):
|
|
pass
|
|
|
|
class type_with_modifiable_dict(Y, type):
|
|
pass
|
|
|
|
class MyClass(object):
|
|
"""This class has its __dict__ attribute completely exposed:
|
|
user code can read, reassign and even delete it.
|
|
"""
|
|
__metaclass__ = type_with_modifiable_dict
|
|
|
|
|
|
if __name__ == '__main__':
|
|
del MyClass.__dict__ # if we set tp_dict to NULL,
|
|
print(MyClass) # doing anything with MyClass segfaults
|