On 07Dec2018 21:20, Steven D'Aprano <st...@pearwood.info> wrote:
On Fri, Dec 07, 2018 at 02:06:16PM +0530, Sunil Tech wrote:
I am using Python 2.7.8
That is important information.
Python 2 unfortunately predates Unicode, and when it was added some bad
decisions were made. For example, we can write this in Python 2:
txt = "abcπ"
but it is a lie, because what we get isn't the string we typed, but the
interpreters *bad guess* that we actually meant this:
txt
'abc\xcf\x80'
Wow. I did not know that! I imagined Python 2 would have simply rejected
such a string (out of range characters -- ordinals >= 256 -- in a "byte"
string).
Cheers,
Cameron Simpson <c...@cskk.id.au>
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor