[Python-ideas] Syntax idea: escaping names to avoid keyword ambiguity

David Mertz mertz at gnosis.cx
Mon May 14 17:26:16 EDT 2018


So does NumPy and sckit-learn use the trailing underscore convention.
Albeit, sklearn uses it for (almost) all the model attributes, not just
those it thinks might clash.

On Mon, May 14, 2018, 2:12 PM Terry Reedy <tjreedy at udel.edu> wrote:

> On 5/14/2018 10:02 AM, Clint Hepner wrote:
> >
> >> On 2018 May 14 , at 6:47 a, Daniel Moisset <dmoisset at machinalis.com>
> wrote:
> >>
> >> Following up some of the discussions about the problems of adding
> keywords and Guido's proposal of making tokenization context-dependent, I
> wanted to propose an alternate way to go around the problem.
> >
> > My main objection to what follows is that it doesn't seem to offer any
> benefit over the current practice of appending an underscore (_) to a
> keyword to make it a valid identifier.
>
> Tkinter uses this convention for a few option names that clash.
>
> --
> Terry Jan Reedy
>
> _______________________________________________
> 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/20180514/3c2eea02/attachment.html>


More information about the Python-ideas mailing list