New to Python - block grouping (spaces)

Marko Rauhamaa marko at pacujo.net
Mon Apr 20 01:09:35 EDT 2015


Chris Angelico <rosuav at gmail.com>:

> On Mon, Apr 20, 2015 at 12:54 PM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> On Mon, 20 Apr 2015 06:41 am, Marko Rauhamaa wrote:
>> Python has a noncanonical textual representation?
>>
>> What is a noncanonical textual representation, and where can I see
>> some?
>
> I think what Marko means is that there is a textual way to represent
> Python source code, and there are multiple files that represent
> identical Python programs, hence "noncanonical". If you have two UTF-8
> encoded files that contain the same text, they will have the exact
> same bytes in them, because UTF-8 defines a canonical byte
> representation for text. You can't say that about Python source.

Yes, more than one Python source file produces an identical AST, and
none of them is obviously the "normal form."


Marko



More information about the Python-list mailing list