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-April/003064.html below:

[Python-Dev] unicode: strange exception

[Python-Dev] unicode: strange exception [Python-Dev] unicode: strange exceptionM.-A. Lemburg mal@lemburg.com
Mon, 03 Apr 2000 23:45:20 +0200
Fredrik Lundh wrote:
> 
> >>> "!" in ("a", None)
> 0
> >>> u"!" in ("a", None)
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> TypeError: expected a character buffer object

Good catch. The same happens when you try to compare
Unicode and a different non-string type:

>>> '1' == None
0
>>> u'1' == None
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: expected a character buffer object

The reason is the same in both cases: failing auto-coercion.
I will send a patch for this tomorrow.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      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