Armin Rigo | b4b5a76 | 2006-01-14 10:58:30 +0000 | [diff] [blame] | 1 | |
2 | # http://python.org/sf/1174712 | ||||
3 | |||||
4 | import types | ||||
5 | |||||
6 | class X(types.ModuleType, str): | ||||
7 | """Such a subclassing is incorrectly allowed -- | ||||
8 | see the SF bug report for explanations""" | ||||
9 | |||||
10 | if __name__ == '__main__': | ||||
11 | X('name') # segfault: ModuleType.__init__() reads | ||||
12 | # the dict at the wrong offset |