This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients Phillip.M.Feldman, Phillip.M.Feldman@gmail.com, ezio.melotti, loewis
Date 2011-10-17.05:41:43
SpamBayes Score 2.3182225e-09
Marked as misclassified No
Message-id <4E9BC014.80901@v.loewis.de>
In-reply-to <CAB2ViTZ2ZZnfueukZQ8yORQK7=nRJTFXZ3Hcju5QCT9TOfXPzg@mail.gmail.com>
Content
Am 17.10.2011 06:22, schrieb Phillip Feldman:
> This is a fine example of the so-called "is-ought" controversy.

Wrong. This has nothing to do with desired and factual. A bug, by
definition, is a deviation from the specification. This is not a bug,
since it exactly follows the specification.

Now you may want to challenge the specification, which makes it a
feature request. However, given that the PEP was discussed in 2001,
you are about ten years late for that.

> underlying problem is that this scheme was poorly thought out.

I object this assessment. This very behavior was carefully considered
and deliberately chosen.

> Clearly, the stripping of comments and the source decoding should both be done in
> a single pass, and the source decoding should not be applied to the
> comments.

That's not clear at all. In general (i.e. for arbitrary encodings), it
is not possible to determine where the hash ("#") signs are in the input
without decoding. So you have to decode first.

In addition, it was a deliberate choice that the source encoding must be
consistent (i.e. all characters in the source must decode correctly),
even if that is not needed for parsing. This is like requiring colons
at the end of statements: they are not needed for parsing, but requiring
them improves the language.

Regards,
Martin
History
Date User Action Args
2011-10-17 05:41:44loewissetrecipients: + loewis, ezio.melotti, Phillip.M.Feldman
2011-10-17 05:41:43loewislinkissue13185 messages
2011-10-17 05:41:43loewiscreate