Skip to content

all builtin types are subclassable, even when they shouldn't be #596

@toshok

Description

@toshok

the following example:

class foo(slice):
    pass

succeeds in pyston and raises in cpython:

TypeError: Error when calling the metaclass bases
    type 'slice' is not an acceptable base type

this is due to the fact that Py_TPFLAGS_BASETYPE is or'ed into the tp_flags of all BoxedClasses. we need a way to either keep that from happening or override it after BoxedClass creation time. we also need to audit our builtins to make sure only the proper ones are subclassable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions