[Biopython-dev] DeprecationWarnings

Peter biopython at maubp.freeserve.co.uk
Fri Sep 3 17:28:32 UTC 2010


On Fri, Sep 3, 2010 at 6:17 PM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
> Hi everybody,
>
> In Python 2.7, DeprecationWarnings are silenced by default; they are shown
> if Python is started with the -Wd option. Most of our users won't use the -Wd
> option and therefore won't see any of the DeprecationWarnings.

I remember you pointed this out last week, I agree this will be a problem.
http://lists.open-bio.org/pipermail/biopython-dev/2010-August/008207.html

> I suggest that
> we replace all DeprecationWarnings in Biopython with a Biopython-specific
> warning, perhaps implemented in Bio/__init__.py, to make sure that users
> actually see these warnings when they occur.

Sounds good, maybe Bio.BioDeprecationWarning would do as a name?

> At the same time, we can add DeprecationWarnings to all functions
> marked as obsolete, since most users won't see these DeprecationWarnings
> anyway (assuming they are using Python 2.7 or later).  This allows us to
> check if any software depends on obsolete code by using the -Wd option
> when starting Python.
>
> Any objections?

Yes. That would be a misuse of DeprecationWarning, and would by very
annoying for people running on Python 2.6 or older (which will probably
be most users for the time being). Instead we can use the built in
PendingDeprecationWarning (which is silent by default):
http://lists.open-bio.org/pipermail/biopython-dev/2009-September/006762.html

Regards,

Peter




More information about the Biopython-dev mailing list