A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-checkins/2002-October/030192.html below:

[Python-checkins] python/dist/src/Lib/email Generator.py,1.16,1.17

[Python-checkins] python/dist/src/Lib/email Generator.py,1.16,1.17Barry A. Warsaw barry@python.org
Mon, 14 Oct 2002 12:36:26 -0400
>>>>> "MAL" == M  <mal@lemburg.com> writes:

    >> + def _is8bitstring(s): + if isinstance(s, StringType): + try:
    >> + unicode(s, 'us-ascii')

    MAL> Note that 'ascii' will be faster since there are short-cuts
    MAL> in the C code which map this directly to the ASCII codec.

Ah cool, thanks for the tip.  I'll make that change.

    >> + except UnicodeError: + return True + return False +

    MAL> Since this kind of function occurs quite often in string
    MAL> related code, wouldn't be better to code it in C and
    MAL> publish it through e.g. the _codecs module ?!

Probably so, or something like it.  I'll see if I can't factor out the
tests I tend to do and make a proposal.

-Barry



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