Message3600

Author ericjacobs
Recipients ericjacobs
Date 2008-09-15.17:45:31
SpamBayes Score 1.64957e-05
Marked as misclassified No
Message-id <1221500732.98.0.840482477904.issue1132@psf.upfronthosting.co.za>
In-reply-to
Content
It should be possible to assign metaclasses to classes that are derived
from Java classes.

import java

class MyClass(java.lang.Object):

    class __metaclass__(type(java.lang.Object)):
        def __new__(cls, name, bases, dict):
            return super(cls, cls).__new__(cls, name, bases, dict)
            
            
o = MyClass()


This results in the cryptic error message:

TypeError: class.__new__(__metaclass__) is not safe, use
__metaclass__.__new__()
History
Date User Action Args
2008-09-15 17:45:33ericjacobssetrecipients: + ericjacobs
2008-09-15 17:45:32ericjacobssetmessageid: <1221500732.98.0.840482477904.issue1132@psf.upfronthosting.co.za>
2008-09-15 17:45:32ericjacobslinkissue1132 messages
2008-09-15 17:45:31ericjacobscreate