Back to index

python3.2  3.2.2
Classes | Variables
loosing_mro_ref Namespace Reference


class  MyKey
class  Base
class  Base2


tuple X = type('X', (Base,), {MyKey(): 5})

Detailed Description

There is a way to put keys of any type in a type's dictionary.
I think this allows various kinds of crashes, but so far I have only
found a convoluted attack of _PyType_Lookup(), which uses the mro of the
type without holding a strong reference to it.  Probably works with
super.__getattribute__() too, which uses the same kind of code.

Variable Documentation

tuple loosing_mro_ref.X = type('X', (Base,), {MyKey(): 5})

Definition at line 32 of file