Movatterモバイル変換
[0]ホーム
[Python-Dev] #pragmas in Python source code
Fred L. Drake, Jr.fdrake@acm.org
Thu, 13 Apr 2000 12:47:52 -0400 (EDT)
Paul Prescod writes: > The XML rule is one encoding per file. One thing that I think that they > did innovate in (I had nothing to do with that part) is that entities I think an important part of this is that the location of theencoding declaration is completely fixed; it can't start five linesdown (after all, it might be hard to know what a line is!). If we say, "The first character of a Python source file must be '#',or assume native encoding.", we go a long way to figuring out what's aline (CR/LF/CRLF can be dealt with in a "universal" fashion), so wecan deal with something a little farther down, but I'd hate to be soflexible that it became too tedious to implement. I'd be moreaccepting of encoding declarations embedded in comments than pragmas. (Not that I *like* abusing comments like that.) So perhaps a Python encoding declaration becomes:#?python encoding="iso-8859-7"?# ;) -Fred--Fred L. Drake, Jr. <fdrake at acm.org>Corporation for National Research Initiatives
[8]ページ先頭