[Python-ideas] Quick idea: defining variables from functions that take the variable name

David Mertz mertz at gnosis.cx
Tue May 31 11:27:28 EDT 2016


This is bikeshedding a bit, but a keyword that looks good to me:

expose Typevar as T
expose Symbol as X
On May 31, 2016 2:06 AM, "Paul Moore" <p.f.moore at gmail.com> wrote:

> On 31 May 2016 at 09:56, Stephen J. Turnbull <stephen at xemacs.org> 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.
>
> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160531/14510b9d/attachment.html>


More information about the Python-ideas mailing list