New submission from Florent Xicluna <florent.xicl...@gmail.com>:

The UnicodeWarning is raised on some dict or set operations.
It is not very helpful, and sometimes annoying.
And it is somewhat inconsistent.


# ** warning not raised **

$ python2.7 -c "print u'd\xe9' in {'foo', 'bar'}"
False
$ python2.7 -c "print 'd\xe9' in {u'foo', u'bar'}"
False
$ python2.7 -c "print 'd\xc3\xa9' in {u'foo', u'd\xe9'}"
False


# ** warning raised **

$ python2.7 -c "print 'd\xe9' in {u'foo', u'd\xe9'}"
-c:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments 
to Unicode - interpreting them as being unequal
False
$ python2.7 -c "print u'd\xe9' in {'foo', 'd\xe9'}"
-c:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments 
to Unicode - interpreting them as being unequal
False

----------
components: Unicode
messages: 147181
nosy: ezio.melotti, flox
priority: normal
severity: normal
status: open
title: UnicodeWarning raised on dict() and set()
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13360>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to