[PyQt] Patch to add a "/Deprecated/" annotation to SIP

Giovanni Bajo rasky at develer.com
Fri Sep 19 19:39:07 BST 2008


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).
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sip_deprecated_patch
Type: text/x-patch
Size: 3412 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080919/f5c62335/sip_deprecated_patch.bin


More information about the PyQt mailing list