Guido van Rossum wrote: > > > """ > > Python will default to Latin-1 as standard encoding if no other > > encoding hints are given. > > """ > > I missed this. Why not default to ASCII like any decent programming > language does in the absence of an explicit encoding? Jack had the same question. The simple answer is: we need this in order to maintain backward compatibility when we move to phase two of the implementation. Here's the longer one: ASCII is the standard encoding for Python keywords and identifiers. There is no standard source code encoding for string literals. Unicode literals are interpreted using 'unicode-escape' which is an enhanced Latin-1 with escape semantics. This makes Latin-1 the right choice: * Unicode literals already use it today * As soon as we get to phase two of the implementation, 8-bit string literals will be have to make the round trip raw binary -> Unicode -> raw binary and this only works if you make Latin-1 the default. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/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