deprecated string module issue

Stephen Hansen me+list/python at ixokai.io
Thu Jun 24 13:24:18 EDT 2010


On Thu, Jun 24, 2010 at 10:06 AM, GrayShark <howe.steven at gmail.com> wrote:

> In my code I have:
> from string import lower, upper
>
> When I use pylint on the program I get just one warning:
>
> Uses of a deprecated module 'string'.
>
> Iv'e noted that many if not all string functions are now in _builtin_.
> Where are the constants?
>

The pylint error is misleading. The string module is not deprecated; all of
the string methods that used to be in it, but are now methods of strings
directly, are.

So instead of lower(your_string), you do your_string.lower().

The constants aren't deprecated (and a couple things have been added to the
module recently, such as the Formatter class).

--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100624/5bbb2cbd/attachment.html>


More information about the Python-list mailing list