[Python-Dev] Re: typing: how to use names in result-tuples?

2019年8月12日 03:28:29 -0700

On 12.08.19 10:52, Ivan Levkivskyi wrote:
> On Thu, 8 Aug 2019 at 17:17, Christian Tismer <[email protected]
> <mailto:[email protected]>> wrote:
> 
> Yes, that's what I mean.
> Probably retval or whatever people prefer would be adequate,
> with a special rule if that name is taken.
> 
> I think btw. that using StructSequence(somename=sometype, ..., ) that
> does a dict lookup is quite appealing. It returns a class like
> stat_result, but the function call shows its arguments (see answer to
> Ronald).
> 
> Ciao -- Chris
> 
> 
> Just a little comment: there is a (vague) plan to add a feature (key
> types) to the type system that will allow user-defined constructs
> similar to NamedTuple (for example StructSequence you mention).
> However, taking into account current schedule it is unlikely it will be
> added before mid-2020, so your best bet is indeed using ad-hoc named tuples.
Interesting! Can I read something more about this? I'm curious ;-)
But I guess it will anyway take a little time until I can make that
transition. Maybe it's better to see what's coming up with typing,
mypy, typing_inspect and friends.
Well, I will probably start a prototype dev branch for that.
Cheers -- Chris
-- 
Christian Tismer :^) [email protected]
Software Consulting : http://www.stackless.com/
Karl-Liebknecht-Str. 121 : https://github.com/PySide
14482 Potsdam : GPG key -> 0xFB7BEE0E
phone +49 173 24 18 776 fax +49 (30) 700143-0023
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/IZM2CKBMBUYH3QPOBTDKRBLNQDYACI75/

Reply via email to