[Types-sig] PyDL RFC 0.02

Greg Stein gstein@lyra.org
Mon, 27 Dec 1999 11:41:20 -0800 (PST)


On Mon, 27 Dec 1999, scott wrote:
> On Mon, Dec 27, 1999 at 04:55:08AM -0800, Greg Stein wrote:
>...
> > > The Python interpreter invokes the static interface interpreter and
> > > optionally the interface checker on a Python file and its associated
> > > PyDL file.  Typically a PyDL file is associated with a Python file
> > > through placement in the same path with the same base name and a
> > > ".pydl"  or ".gpydl" extension. If both are avaiable, the module'sj
> > > interface is created by combining the declarations in the ".pydl" and
> > > ".gpydl" files.
> > 
> > The notion of two types of files just adds complexity. There is no reason
> > that a generated file would be *any* different in form/syntax than a
> > human's file. The human just gets to add funky comments, indentation, etc.
> > 
> > In other words: design around a single file.
> 
> Greg, are you suggesting a single file which gets generated type info
> appened automatically?

Nope. It sounded like Paul was suggesting different formats, suffixes, and
purpose. I don't think we should go that route.

It would seem best to have a .pyi file that a human can craft and
maintain. It would be quite easy to have the type-check mode warn the user
that they haven't declared some interface or something (so they can go
and add it in). Heck, maybe the
user did that on purpose, because the class isn't public. It would also be
quite possible to invoke the type-checker with a mode that says "generate
a .pyi file for me." The user can then edit the thing as needed.

I also think that we'd want to avoid "combining the declarations" of two
files. Again, the user may not want the second group of declarations. And
the combination rules might be a bit hard to describe or handle (from the
human's standpoint).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/