- The C dumpers cannot be subclassed. Subclassing from Python makes
difficult to use the c fast path, unless doing relatively expensive
checks.
- C optimised classes are chosen on registration. The types module only
exposes the Python objects, so they can be documented and subclassed.
Override adapter in the respective type modules
This way they are properly exposed to the rest of the Python code.
Note that it will need some trickery to be able to subclass them in
Python: overridden adapter will need the C fast path bypassed if
subclassing is detected.
Export C int subclasses dumpers to Python
Added guards to allow subclassing C adapters
Not sure this is the way to go though. Subclassing might be a rare
enough case to just make the classes final.
The check is implemented at instance level: it would be more efficient
to implement it at class level, however I don't know how to store class
attribute or implement metaclasses in Cython.
Don't make C types subclassable
C types are no more exposed in types, so they won't get subclassed by
final users.
Checking for subclass in adaptation is expensive, so I'd rather not do
it.
Check if a class has a matching optimised class (with the same name) at
registration time.