This is bikeshedding a bit, but a keyword that looks good to me:
expose Typevar as T
expose Symbol as X
On 31 May 2016 at 09:56, Stephen J. Turnbull <email@example.com> wrote:
> I know you don't think a keyword works for you, but
> either the recently reraised "def <name> = <type-expr>" or perhaps
> "type <name>: <type-expr>" make more sense to me right out of the box.
I was thinking along the lines of "name <some_keyword> callable",
which I don't think works because it needs some "punctuation" to
separate the name from the callable.
But "def name = callable" (or some other preceding keyword combined
with =) might work. I don't like "type" though, as the point here (I
thought - see below) is to come up with a construct useful for more
than just types.
> I'm +1 for stopping the bikeshedding until we've all got a lot of
> stubfile reading under our belts.
If this was simply about type definitions, I'd agree. But I thought
the point of Guido's post was that having seen two examples (TypeVar
and Symbol) is there a more general approach that might cover these
two cases as well as others? So just looking at the problem in terms
of stub files isn't really the point here.
Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/