[Types-sig] Type annotations

Martijn Faassen m.faassen@vet.uu.nl
Thu, 16 Dec 1999 19:20:15 +0100


Paul Prescod wrote:
[snip snip]
> My preference is to allow three different syntaxes according to a
> schedule:
> 
>         January: separate files (we need this anyhow to define types for the
> builtin modules)
>         February: in-module string declarations and build separate files
>         Python 2.0: either 3 or 4
> 
> I admit that I don't find the compatibility benefits of 5 to be worth
> the obfuscation. Parsing is not THAT hard.

But it doesn't completely obfuscate; it's _in Python_. Python
programmers already grok Python syntax. It looks fairly horrible, but
it's also readable by Python programmers, and so it's easier to
communicate.

And you don't have to deal with parsing only; that isn't the main
problem. The main thing is that we need a way to express complex,
composite types. Python is very expressive. You can make a Pythonic
language to express types in later, but we can't yet as we don't fully
know yet what we want to express.

Yet another advantange of going the 'in Python' route is that you
already have the backend for your parser. And if you have an
implementation (that we'll undoubtedly will change several times,
another advantage of using Python), you can actually start thinking
about a good syntax with *knowledge*. You know what kind of data
structures are actually involved, you have working experience. Something
we don't really have right now.

Regards,

Martijn