Welcome!

I would just define a module level constant that uses a Unicode escape 
sequence. The code is self-documenting, and doesn’t require the runtime 
overhead of the chr function:

ZERO_WIDTH_SPACE = "\u200b"

I personally don’t think this is a common/important enough case to be 
documented any further (it’s now here on the mailing list archives). PEP 8 is 
more of a style guide, not a design guide!

Brandt

> On Nov 10, 2019, at 06:33, Artemis <hollyshor...@gmail.com> wrote:
> 
> What should one do when one wants to put a zero width space or other 
> invisible character in code?
> These are often not displayed in editors, which can lead to confusion. I see 
> two solutions:  
> - include it but add a comment noting it
> - use the chr function to get the character (and add a comment saying what it 
> is)
> Where should a guideline for this go (PEP 8?)? What should the guideline be 
> (one of these or something else?)?
> 
> This is my first time contributing in any way to Python, please excuse me if 
> I've done it in the wrong place/format.
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-ideas@python.org/message/6XBJGGV6XTNN5CICTCI2457QDG2RASRF/
> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/ACGYL6Z5TM5U7TURHP7K225MTXAHCIEI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to