This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author devkid
Recipients devkid, eryksun
Date 2015-01-20.08:40:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421743220.38.0.71846891319.issue23276@psf.upfronthosting.co.za>
In-reply-to
Content
Can you elaborate what QtClass and QtMeta is in your case?

My original example was reduced to a minimal case and seems to work with your suggestions.

The complete example involving SQLalchemy is here:

http://stackoverflow.com/questions/28032928/sqlalchemy-multiple-base-classes-not-working

and does, however, not work.

If I try to do

    # ...

    def __setattr__(cls, key, value):
        super(type(QMediaPlaylist), cls).__setattr__(cls, key, value)
        return

The program segfaults when instantiating the Playlist class. However, this approach seems a little bit strange to me anyhow.

The same happens when I try to do:

    # ...

    def __setattr__(cls, key, value):
        super(type(base), cls).__setattr__(cls, key, value)
        return

I think that comes from PyQt specific attributes SQLalchemy is trying to set / replace.

So, coming back to the original question, how can I actually set an attribute of my class Playlist from within its metaclass without involving the parent classes of the subclass (type(base) and type(QMediaPlaylist))? Because the __setattr__ from PyQt won't work (segfault) and the one from SQLalchemy does stupid stuff.
History
Date User Action Args
2015-01-20 08:40:20devkidsetrecipients: + devkid, eryksun
2015-01-20 08:40:20devkidsetmessageid: <1421743220.38.0.71846891319.issue23276@psf.upfronthosting.co.za>
2015-01-20 08:40:20devkidlinkissue23276 messages
2015-01-20 08:40:20devkidcreate