Undefined Behaviour
These are the undefined behaviours of pkpy. The behaviour of pkpy is undefined if you do the following things.
-
Modify or delete an attribute of a builtin type. For example,
int.__add__ = fordel int.__add__. The interpreter takes fast paths that assume the arithmetic and comparison methods ofintandfloatare the original ones. -
Call an unbound method with the wrong type of
self. For example,int.__add__('1', 2). -
Type
T's__new__returns an object that is not an instance ofT. -
Call
__new__with a type that is not a subclass oftype.