Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"is not" and "!=" are indistinguishable. #15

Closed
YorikSar opened this issue Feb 20, 2012 · 4 comments
Closed

"is not" and "!=" are indistinguishable. #15

YorikSar opened this issue Feb 20, 2012 · 4 comments

Comments

@YorikSar
Copy link

They should be converted to different characters.
For example, "is" and "is not" can use the identity (≡, ≢) while != should be converted to ≠. Don't know what to do with == then, but at least this version will be definitive.

@ehamberg
Copy link
Owner

Hi,

Thanks for reporting this. The translation is not → ≠ was added to avoid is not being translated to is ¬ (see issues/14), but you raise a good point in that it now not possible to tell is not apart from != in concealed code.

The following translations could be used (with the caveat that might be hard to read if the font is very small):

  • !=
  • is
  • is not

But == is trickier. Any suggestions? :)

@YorikSar
Copy link
Author

May be, replace = with ≔ and then == with = ?
But it's not too good to change meaning of the =.

@ehamberg
Copy link
Owner

I discussed this a bit with the local Python guru and I'm leaning towards leaving is and is not alone (and not touching the “not” when after “is”) and use and for != and ==, respectively.

is is used far less often than == – and since it's just a pointer comparison, its meaning is farther off from ‘≡’ than == since the latter will actually check that the values are the same.

It will then be:

  • foo == barfoo ≡ bar
  • foo != barfoo ≠ bar
  • foo is barfoo is bar
  • foo is not barfoo is not bar

Comments? :-)

@YorikSar
Copy link
Author

I don't think it's a good idea to use identity in place of equality. Geeks will not approve.
At least replacement should be consistent - like both == and != to ≡ and ≢.

ehamberg added a commit that referenced this issue Mar 3, 2012
To make it possible to distinguish between `is`/`is not` and `==`/`!=`,
the former pair will not be concealed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants