You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like
black is used by many python projects. It would be great if black could replace "Bidi overrides" with the appropriate escape characters that are visible to humans.
Describe alternatives you've considered
Wait for the python interpreter(s) to fix it.
Additional context
The text was updated successfully, but these errors were encountered:
This seems reasonable to me. These can appear in string literals and comments, right? Are there any other places where markers could appear in the source code?
Also, is there any risk that this will be a bad experience for people writing Python code in RTL languages (e.g., with comments or even variable names in Arabic or Hebrew)?
As far as I understand, this affect everything written in unicode/utf8: comments, literals, and most importantly the code itself. The referenced paper focuses on altering the code itself. The paper has a quick example on page 3 for python (Fig 1 is how the interpreter "sees" it and Fig 2 is how it is rendered, how the human/reviewer sees it):
Also, is there any risk that this will be a bad experience for people writing Python code in RTL languages (e.g., with comments or even variable names in Arabic or Hebrew)?
It be good to get feedback from people writing code in RTL languages.
Thanks. For your first example, the marker is in a string literal from Black's perspective, which is good because it means it's safe to change it into an escaped character.
Is your feature request related to a problem? Please describe.
"Trojan Source Attacks" https://www.trojansource.codes/trojan-source.pdf can create a discrepancy between how code looks to reviewers and how it is interpreted by python.
Describe the solution you'd like
black is used by many python projects. It would be great if black could replace "Bidi overrides" with the appropriate escape characters that are visible to humans.
Describe alternatives you've considered
Wait for the python interpreter(s) to fix it.
Additional context
The text was updated successfully, but these errors were encountered: