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

Michael Selik michael.selik at gmail.com
Wed Jun 8 18:57:41 EDT 2016


On Wed, Jun 8, 2016 at 5:10 PM Barry Warsaw <barry at python.org> wrote:

> On Jun 08, 2016, at 12:43 PM, Nikolaus Rath wrote:
> 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).
>

For what it's worth, __LHS__ seems best to me, of the suggestions so far.
The fact that it's all caps suggests even more magic than most dunders.

To recap the problems this might solve:
1. pass identifier as string arg (seems trivial, status quo is fine)
2. get name and qualname for pickling (instead of sys._getframe)
3. @public for constants (as per Barry's email)

I don't know what that last one was referring to. Do you mind clarifying,
Barry (or anyone else)?

Any other problems this could help with?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160608/ee37db85/attachment.html>


More information about the Python-ideas mailing list