From pykde Sat Sep 20 13:18:38 2008 From: Phil Thompson Date: Sat, 20 Sep 2008 13:18:38 +0000 To: pykde Subject: [PyQt] Re: Patch to add a "/Deprecated/" annotation to SIP Message-Id: X-MARC-Message: https://marc.info/?l=pykde&m=122191722427655 On Fri, 19 Sep 2008 20:39:07 +0200, Giovanni Bajo wrote: > Hi Phil, > > this patch to SIP adds a "/Deprecated/" annotation that can be used to > mark functions that are deprecated. It causes a DeprecationWarning to be > raised at runtime whenever the function is invoked. > > Once a package correctly uses /Deprecated/, the users of the package can > disable the warning (if they find it annoying) using the standard Python > warning filter machinery (eg: it allows to disable warnings by matching > the module name with a regexp). So I don't see a need to provide an > alternative way to compile it on/off (eg: as SIP command line argument), > nor at runtime. > > This will be used by an upcoming PyQt3Support release that will mark all > PyQt3 classes and methods as deprecated, to allow developers to quickly > identify spots where Qt3Support is still in use. > > The patch has been written by Lorenzo Berni (I'm submitting it on his > behalf). Applied - with a few changes... You can also apply the annotation to a class so that all its sub-classes, ctors and methods get deprecated. I've improved the messages generated. Thanks, Phil _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt