पर विचार करें:UnicodeWarning निकाल दिया केवल एक बार
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 'abc' == u'abc'
True
>>> 'ab\xDF' == u'abc'
__main__:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
False
>>> 'ab\xDF' == u'abc'
False
क्यों चेतावनी दूसरी बार के लिए निकाल दिया है ना? मुझे लगता है कि इसमें इंटर्निंग के साथ कुछ करना है, लेकिन यह पता नहीं लगा सकता कि वास्तव में क्या है।
मैं एक cpython-स्रोत स्तर स्पष्टीकरण की सराहना करता हूं।
धन्यवाद, यह बताता है। – georg