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-July/005455.html below:

[Python-Dev] Docs for string methods ?

[Python-Dev] Docs for string methods ? [Python-Dev] Docs for string methods ?Fredrik Lundh fredrik@pythonware.com
Wed, 5 Jul 2000 12:20:04 +0200
mal wrote:
> Fredrik Lundh wrote:
> > 
> > mal wrote:
> > > I've just checked in new string methods
> > 
> > talking about string methods: how about providing an
> > "encode" method for 8-bit strings too?
> 
> I've tossed that idea around a few times too... it could
> have the same interface as the Unicode one (without default
> encoding though). The only problem is that there are currently
> no codecs which could deal with strings on input.

imho, a consistent interface is more important than a truly
optimal implementation (string are strings yada yada).  or in
other words,

    def encode(self, encoding):
        if encoding is close enough:
            return self
        return unicode(self).encode(encoding)

ought to be good enough for now.

</F>




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