[Python-bugs-list] [ python-Feature Requests-662827 ] optional pad character for zfill and center

SourceForge.net noreply@sourceforge.net
Sat, 11 Jan 2003 20:44:12 -0800


Feature Requests item #662827, was opened at 2003-01-05 16:28
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=662827&group_id=5470

Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: David Torpey (dtorp)
Assigned to: Nobody/Anonymous (nobody)
Summary: optional pad character for zfill and center

Initial Comment:
>>> 'padme'.zfill(10, '*')
'*****padme'
>>> 'padme'.center(10, '*')
'**padme***'


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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-01-11 23:44

Message:
Logged In: YES 
user_id=80475

I checked with Guido and he thinks the feature is "nifty" but 
that the language is cleaner and easier to maintain without 
it (especially since it would entail similar changes to the 
unicode and UserString modules).

Thank you for the suggestion.

Closing the request.

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-01-10 04:42

Message:
Logged In: YES 
user_id=80475

The optional character for center seems like a useful idea 
to me.  People occasionally like to center captions in fields 
of hyphens or asterisks.  Note, this proposal is similar to 
the recent "optional character" enhancements to str.strip
(), str.lstrip(), and str.rstrip().

Doing the same for zfill() is more problematic because 
both its name and function do not equate to "padleft".  
The 'z' in zfill implies that a zero will be used.  The actual 
function not only fills to the left, but also repositions any 
leading minus signs.

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

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