[Python-ideas] Proposal for special name and qualname symbols

Barry Scott barry at barrys-emacs.org
Thu Jun 9 05:12:17 EDT 2016


On Wednesday 08 June 2016 17:10:16 Barry Warsaw wrote:
> On Jun 08, 2016, at 12:43 PM, Nikolaus Rath wrote:
> >This is so similar (in both semantics and syntax) to the
> >
> >Record = namedtuple($lhs, fields)
> >
> >proposal that I've made several times in that thread that I am a little
> >offended. Either you've not read that thread all that thorougly, or you
> >have a rather selective memory.
> 
> It's of course quite easy to miss a specific suggestion in the various
> millithreads on this list, or not quite connect the dots to see the
> similarities on the initial read.  Just be happy that great minds think
> alike. :)

Indeed I just posted along the same line, and missing both the @ and $lhs
before posting. I had thought to use a builtin to get the variable names.
I think the __LHS__ is the more general and powerful.

> On to the topic at hand, when I saw your suggestion and Steve's I
> immediately thought I'd like to see a special symbol like __LHS__, e.g.
> 
> Record = namedtuple(__LHS__, fields)
> 
> which would at least have the benefit of not introducing a special
> character, and one that could be confusing in other contexts (e.g. PEP 292
> strings).



> 
> Cheers,
> -Barry



More information about the Python-ideas mailing list