[Python-ideas] Allow additional separator character in variables

Nikolaus Rath Nikolaus at rath.org
Mon Nov 20 16:04:00 EST 2017


On Nov 18 2017, Bruce Leban <bruce-lcXLltxty2U at public.gmane.org> wrote:
> And because spaces between words is mostly not valid syntax currently, this
> change would be easier to introduce than breaking every single program out
> there by re-purposing hyphen-minus. But I'm not seriously proposing this
> because I think the modest benefits are outweighed by the many problems it
> would introduce.

Luckily, there is a compromise: use backticks to quote identifiers:

`test mode` = True
if `test mode`:
   `display message`("just a test")


I'm not seriously suggesting that, but I still wonder what people think
about it.

I sort of like it, actually. The `(" part is pretty ugly (which is why I
included it in the example), but there's no syntax that can completely
avoid ugly corner cases. I think in most cases the context would also
make it easy to distinguish single quotes and backticks even when
they're typographically similar.


Cheers,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the Python-ideas mailing list