Typed Python?

Jeremy Bowers jerf at jerf.org
Mon Jul 5 15:10:07 EDT 2004


On Mon, 05 Jul 2004 15:02:59 +0200, Peter Maas wrote:
> You mean the expression
> 
> "(set! x 10)" is_better_structured_as "x=10"
> 
> is true? How is is_better_structured_as defined? :)

def is_better_structured_than(a, b): # take Peter's suggestion
    "Returns true if a is better structured than b."
    if not equivalent(a, b):
        raise ThatsNotFairError

    return len(a) > len(b)


(It is the only logical interpretation of the statement since in any sane
parse tree of the two on some fair ground they are indistinguistable. If
you don't like this logic, Jacek, I recommend meditating on your knowledge
of computer science, not blaming me; I mean that first sentence quite
literally.)




More information about the Python-list mailing list