From: GrayShark on
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?

Thanks
Steven
From: GrayShark on
On Jun 24, 10:06 am, GrayShark <howe.ste...(a)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?
>
> Thanks
> Steven

Sorry, I meant "from string import lowercase, uppercase"

As I was joining these two, I just changed the import to 'letters'

So if the constants are not deprecated, why is the module? Is some
other
state then deprecated needed to describe functions and/or methods
deprecated,
but not whole modules?

It just seems wrong, this all or nothing state.

Steven
From: Thomas Jollans on
On 06/24/2010 07:39 PM, GrayShark wrote:
> On Jun 24, 10:06 am, GrayShark <howe.ste...(a)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?
>>
>> Thanks
>> Steven
>
> Sorry, I meant "from string import lowercase, uppercase"
>
> As I was joining these two, I just changed the import to 'letters'
>
> So if the constants are not deprecated, why is the module? Is some
> other
> state then deprecated needed to describe functions and/or methods
> deprecated,
> but not whole modules?

It's not.

http://docs.python.org/library/string.html

"""The string module contains a number of useful constants and classes,
as well as some deprecated legacy functions that are also available as
methods on strings."""

Maybe it's deprecated in pylint-land, but the docs appear to disagree.
And I'd say it's clear whose authority is higher.

Thomas

>
> It just seems wrong, this all or nothing state.
>
> Steven

From: Terry Reedy on
On 6/24/2010 1:50 PM, Ixokai wrote:
> On Thu, Jun 24, 2010 at 10:39 AM, GrayShark <howe.steven(a)gmail.com
>> So if the constants are not deprecated, why is the module? Is some

> Again: the string module is not deprecated. It simply is not.

GrayShark, pylint has a bug. Tell the author that its over-enthusiastic
message mislead you.
--
Terry Jan Reedy

From: Benjamin Peterson on
GrayShark <howe.steven <at> gmail.com> writes:

> Sorry, I meant "from string import lowercase, uppercase"

Technically, you should use ascii_lowercase and ascii_uppercase, though I don't
know if that's the cause of pylint's complaints.



 |  Next  |  Last
Pages: 1 2 3
Prev: use python as a calculator
Next: mod_python and css