A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-November/010720.html below:

[Python-Dev] A house upon the sand)

string methods (was Re: [Python-Dev] A house upon the sand) string methods (was Re: [Python-Dev] A house upon the sand)M.-A. Lemburg mal@lemburg.com
Mon, 27 Nov 2000 10:32:46 +0100
Fredrik Lundh wrote:
> 
> Charles wrote:
> > On the other hand it is not clear to me why "capwords" and "zfill" did
> > not become methods of string objects.
> 
> fwiw, they were both present in my original unicode
> implementation:
> 
> >>> from unicode import unicode
> >>> a = unicode("hello world")
> >>> a.capwords()
> 'Hello World'
> >>> a.zfill(20)
> '000000000hello world'

.zfill() is implemented for both strings and Unicode, .capwords()
only for Unicode. Both are disabled, though. I talked with
Guido about these methods and we decided to leave those two
methods disabled in the implementation. They just don't provide
much extra generally useful functionality.

s.capwords() can be emulated with ' '.join(s.capitalize().split()),
BTW.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4