New submission from Daniel U. Thibault :
https://docs.python.org/3/reference/import.html#importsystem
"Other mechanisms for invoking the import system (such as
importlib.import_module()) may choose to subvert __import__() and use its own
solution to implement import semantics."
Daniel U. Thibault added the comment:
>>> mystring="äöü"
>>> myustring=u"äöü"
>>> mystring
'\xc3\xa4\xc3\xb6\xc3\xbc'
>>> myustring
u'\xe4\xf6\xfc'
>>> str(mystring)
'\xc3\xa4\xc3\xb6\xc3\xbc'
Daniel U. Thibault added the comment:
"The default encoding is normally set to ASCII [...]. When a Unicode string is
printed, written to a file, or converted with str(), conversion takes place
using this default encoding."
>>> u"äöü"
u'\xe4\xf6\xfc'
Daniel U. Thibault added the comment:
"It seems to me the statement is correct as written. What experiments indicate
otherwise?"
Here's a simple one:
>>> print «1»
The guillemets are certainly not ASCII (Unicode AB and BB, well outside ASCII's
7F upper limit) b
New submission from Daniel U. Thibault:
Near the end of 3.1.3
http://docs.python.org/2/tutorial/introduction.html#unicode-strings you can
read:
"When a Unicode string is printed, written to a file, or converted with str(),
conversion takes place using this default encoding."
T