You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aggdraw.Draw, aggdraw.Pen, aggdraw.Brush, and the other classes are not sub-classable / extendable (apparently.)
They are not even considered classes at all by python. Taking the type of an instance dos deliver something that are considered classes. But they are not extendable nor typable.
Can I request that some way to subclass the classes be provided. Or some hooks to enable subclassing.
Any details needed for this request please ask.
The why, is because it is very desirable in many situations to sub-class those classes. Wrapping and proxying them will work except that doing an instance class check still becomes impossible.
Thank you.
The text was updated successfully, but these errors were encountered:
See #58 and #45. Basically aggdraw was written a long time ago and does some questionable things to produce instance objects. The "classes" are essentially C functions that return instances of the object class with the necessary pieces filled in. The side effects of this are as you described, aggdraw's classes can't be used like normal classes. Things like type(instance_obj) can cause segmentation faults. Aggdraw "classes" can't be subclassed.
In #45 I describe how we should convert aggdraw to use Cython to wrap the low-level C++ library. However, we first need to resolve #67 as our master branch is producing inconsistent results with old versions of aggdraw. This wasn't figured out until after the major migration to the new agg library. Due to limited time (this is a volunteer project) I can't justify cython-izing old versions of aggdraw knowing that I'd have to do major work to do it again with the new agg library.
If you don't mind I'm going to close this as a duplicate of #45. If you feel strongly about it we can reopen this.
aggdraw.Draw, aggdraw.Pen, aggdraw.Brush, and the other classes are not sub-classable / extendable (apparently.)
They are not even considered classes at all by python. Taking the type of an instance dos deliver something that are considered classes. But they are not extendable nor typable.
Can I request that some way to subclass the classes be provided. Or some hooks to enable subclassing.
Any details needed for this request please ask.
The why, is because it is very desirable in many situations to sub-class those classes. Wrapping and proxying them will work except that doing an instance class check still becomes impossible.
Thank you.
The text was updated successfully, but these errors were encountered: