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-September/009231.html below:

[Python-Dev] hasattr() and Unicode strings

[Python-Dev] hasattr() and Unicode strings [Python-Dev] hasattr() and Unicode stringsAndrew Kuchling akuchlin@mems-exchange.org
Thu, 07 Sep 2000 16:01:44 -0400
hasattr(), getattr(), and doubtless other built-in functions
don't accept Unicode strings at all:

>>> import sys
>>> hasattr(sys, u'abc')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: hasattr, argument 2: expected string, unicode found

Is this a bug or a feature?  I'd say bug; the Unicode should be
coerced using the default ASCII encoding, and an exception raised if
that isn't possible.

--amk



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