<div dir="ltr"><div><div><span style="font-size:12.8px">> The fundamental use-case here is "any object that needs to know its own</span></div><div><span style="font-size:12.8px">> name". Most objects need more than just a name.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">A more general solution could be:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">    def x, y, z as <expression></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Where <expression> should return a callable that accept only one argument. So, you can do some like:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">    def Type(bases, namespace):</span></div><div><span style="font-size:12.8px">        def get_name(name):</span></div><div><span style="font-size:12.8px">            return type(name, bases, namespace)</span></div><div><span style="font-size:12.8px">        return get_name</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">    def x, y, z as Type(bases, namespace)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">That is a syntax sugar of:</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">    dummy = Type(bases, namespace)</span></div><div><span style="font-size:12.8px">    x = dummy("x")</span></div><div><span style="font-size:12.8px">    y = dummy("y")</span></div><div><span style="font-size:12.8px">    z = dummy("z")</span></div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-31 12:27 GMT-03:00 David Mertz <span dir="ltr"><<a href="mailto:mertz@gnosis.cx" target="_blank">mertz@gnosis.cx</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">This is bikeshedding a bit, but a keyword that looks good to me:</p>
<p dir="ltr">expose Typevar as T<br>
expose Symbol as X<br>
</p>
<div class="gmail_quote">On May 31, 2016 2:06 AM, "Paul Moore" <<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 31 May 2016 at 09:56, Stephen J. Turnbull <<a href="mailto:stephen@xemacs.org" target="_blank">stephen@xemacs.org</a>> wrote:<br>
> I know you don't think a keyword works for you, but<br>
> either the recently reraised "def <name> = <type-expr>" or perhaps<br>
> "type <name>: <type-expr>" make more sense to me right out of the box.<br>
<br>
I was thinking along the lines of "name <some_keyword> callable",<br>
which I don't think works because it needs some "punctuation" to<br>
separate the name from the callable.<br>
<br>
But "def name = callable" (or some other preceding keyword combined<br>
with =) might work. I don't like "type" though, as the point here (I<br>
thought - see below) is to come up with a construct useful for more<br>
than just types.<br>
<br>
> I'm +1 for stopping the bikeshedding until we've all got a lot of<br>
> stubfile reading under our belts.<br>
<br>
If this was simply about type definitions, I'd agree. But I thought<br>
the point of Guido's post was that having seen two examples (TypeVar<br>
and Symbol) is there a more general approach that might cover these<br>
two cases as well as others? So just looking at the problem in terms<br>
of stub files isn't really the point here.<br>
<br>
Paul<span class=""><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</span></blockquote></div>
<br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br></blockquote></div><br></div>