Message10214

Author zyasoft
Recipients kensingtoncat, zyasoft
Date 2015-09-03.20:41:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441312893.33.0.376419469617.issue2389@psf.upfronthosting.co.za>
In-reply-to
Content
This was changed in 2.7 beta 4 per NEWS:

    - Abstract methods of an inherited class or interface from Java
      now raise NotImplementedError, instead of returning None (in
      Java, null) or some "zero", if they are not implemented in the
      extending Python class.

It should be straightforward to provide a class decorator -- or
equivalently, a function on classes -- that supports the original
behavior. Maybe even put this decorator in jythonlib?

@jythonlib.NotImplementedMethodsReturnNone
class MyAdapter(InternalFrameAdapter):
    def internalFrameActivated(self, e):
		print e

or perhaps have a slightly more precise decorator, let's call it
NotImplementedVoidMethodsDoNothing. Completely explicit here - void
methods per above are for side effects, so not doing anything can be
quite reasonable.
History
Date User Action Args
2015-09-03 20:41:33zyasoftsetmessageid: <1441312893.33.0.376419469617.issue2389@psf.upfronthosting.co.za>
2015-09-03 20:41:33zyasoftsetrecipients: + zyasoft, kensingtoncat
2015-09-03 20:41:33zyasoftlinkissue2389 messages
2015-09-03 20:41:32zyasoftcreate