[Biopython-dev] Use of depreciated string functions
Peter
biopython at maubp.freeserve.co.uk
Fri Nov 21 10:26:52 EST 2008
On Fri, Nov 21, 2008 at 3:19 PM, Bruce Southey <bsouthey at gmail.com> wrote:
> Hi,
> There are a number of files in Bio that import string. Many of these use
> depreciated functions (since Version 2) that are now string methods mainly
> string.atof(), string.atoi() and string.join(). The only real advantage of
> modifying these is to remove an import statement because these will not be
> removed until Python 3.
>
> Perhaps the one exception is in HotRand.py: hex_digit =
> string.hexdigits.find( letter )
>
> There are about 23 unique files that I identified via grep and many have
> more than one usage. While changing these is busy work, please let me know
> if you would like me to create patches for the next version of Biopython (ie
> 1.50) or just ignore this.
As you say, there isn't much benefit from doing this other than
removing an import and making another small step towards Python 3.0
compatibility. We have gradually been phasing out "import string"
already, usually when working on a module which used it.
Once I've dealt with Biopython 1.49, I'd be happy to look at a patch
to remove more "import string" usage from non-obsolete, non-deprecated
code. It would be a little risky doing this to modules without unit
tests, but that's another area you've shown some interest in anyway...
Thanks,
Peter
More information about the Biopython-dev
mailing list