Roman Suzi wrote: >=20 > On Sat, 14 Jul 2001, M.-A. Lemburg wrote: >=20 > >directive unicodeencoding =3D 'latin-1' >=20 > >#!/usr/local/python > >""" Module Docs... > >""" > >directive unicodeencoding =3D 'latin-1' > >... > >u =3D "H=E9ll=F4 W=F6rld !" > >... >=20 > Is there any need for new directive like that? > Maybe it is possible to use Emacs-style "coding" directive > in the second line instead: >=20 > #!/usr/bin/python > # -*- coding=3Dutf-8 -*- > ... I already mentioned allowing directives in comments to work around the problem of directive placement before the first doc-string. The above would then look like this: #!/usr/local/bin/python # directive unicodeencoding=3D'utf-8' u""" UTF-8 doc-string """ The downside of this is that parsing comments breaks the current tokenizing scheme in Python: the tokenizer removes comments before passing the tokens to the compiler ...wouldn't be hard to=20 fix though ;-) (note that tokenize.py does not) --=20 Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/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