Pilint says the string module is deprecated. What is a new way to get a range of lowercase characters?

I just drank the code and noticed that a colleague imported the old "string" Python module in order not to use any functions from it, but simply to have access to the string.lowercase constant.

I removed the obsolete import and replaced the "abcdef ..." for string.lowercase, but I was wondering: is there a better way I should do this?

+15
python pylint
May 20 '13 at 14:04
source share
1 answer

string itself is not deprecated, just methods like string.join that are better accessible through a string object. You can still import string and get string.ascii_lowercase for what you want.

pylint reporting this as an error is a known error - see http://www.logilab.org/ticket/2481 .

+21
May 20 '13 at 14:08
source share
— -



All Articles