Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/test/crashers/dangerous_subclassing.py

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



# http://python.org/sf/1174712

import types

class X(types.ModuleType, str):
    """Such a subclassing is incorrectly allowed --
    see the SF bug report for explanations"""

if __name__ == '__main__':
    X('name')    # segfault: ModuleType.__init__() reads
                 # the dict at the wrong offset

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.