Tres Seaver wrote:
Note that I have just figured out that we can make DeprecationWarnings
more useful by passing the 'stacklevel' argument to 'warnings.warn';
passing a value of 2 for that argument causes the warning to be reported
against the *caller* of the code issuing the warning, which makes it
possible to find and remove the deprecated use.

Yes, I've changed a number of those in Zope and CMF already. It's very useful for deprecation.

Note that I prefer passing the stacklevel=2 (or 3) argument by name to be explicit.

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to