[Patches] [ python-Patches-561832 ] Class attributes for string object
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 29 May 2002 09:51:36 -0700
Patches item #561832, was opened at 2002-05-29 02:24
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=561832&group_id=5470
Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Class attributes for string object
Initial Comment:
This patch attaches the following class attributes to
stringobject:
whitespace, lowercase, ascii_lowercase, uppercase,
ascii_uppercase, letters, ascii_letters, digits, hexdigits,
octdigits, punctuation, printable.
The implementation is nearly trivial, OTOH I didn't find a
place where PyString_Type is initialized, so I did it lazily
in the tp_getattro function.
----------------------------------------------------------------------
>Comment By: Raymond Hettinger (rhettinger)
Date: 2002-05-29 11:51
Message:
Logged In: YES
user_id=80475
I understand that these are being put in to provide
alternatives to the string module but had always thought
they should have been mappings rather that strings. Is
now a good time to make the switch before this all gets
set in stone?
if c not in str.printable: c='*' # works faster as a mapping
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=561832&group_id=5470