[Patches] [ python-Patches-626105 ] Take advantage of string.center

noreply@sourceforge.net noreply@sourceforge.net
Mon, 21 Oct 2002 12:08:14 -0700


Patches item #626105, was opened at 2002-10-21 00:03
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=626105&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
>Resolution: Accepted
Priority: 4
Submitted By: Raymond Hettinger (rhettinger)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: Take advantage of string.center

Initial Comment:
Replaces the _center function in the calendar
module with the center method for strings.

For situations with uneven padding, the behavior is 
slightly different in that the center method puts the 
extra space on the right instead of the left:

>>> 'the'.center(6)
' the  '
>>> calendar._center('the', 6)
'  the '

Gives minor improvements in speed, readability, code 
size, and tutorial value.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-10-21 21:08

Message:
Logged In: YES 
user_id=21627

The patch looks fine, please apply it.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=626105&group_id=5470