# [Python 2], 35 bytes

<!-- language-all: lang-python -->

 lambda a,b:(a^b)&-(a^b)in[a^b or[]]

[Try it online!][TIO-ju8bwehe]

[Python 2]: https://docs.python.org/2/
[TIO-ju8bwehe]: https://tio.run/##fVHdbsIgGL3nKYgmAyya0szEkHSXewLvms7QFidLpYSypW7Zs3dgrc65jRv4zl8OYA5u1@ikL5tKppPJpK/FvqgEFLTgWDwV5G5@3JTO/AYbm@V573UZ43OWAyA7WWK0TVEUEggAxirt4BbHlBE4hWGlD3BtX93ucCYZjf8hlwlN7o/8L6TPPXk9@SjqVl6T7Ez@dDLKkr@cyXJJb2IHFoApXMvWqxoLPdI6pSUIt90USqcILV4apTH64PGq@EQLL9sLhxtb4ZKQYCqh0nB4njAWygXACv0scS01HrMI4QCOw2ZbK2NkBdMzlHFvzSMUM5SdsQClKYpRHn3HIsbzU9glaOxa7iz2N8Pj3BGaDFW70OxdGTzLlJMW37Qh@WxFCIDOHnxZeP39o8rzl3/05@GV0ZuoVcURtdKcki962ZXSOG5E2/Zf "Python 2 – Try It Online"

Uses the power-of-two check `n&-n==n`, eliminating the `n==0` false positive.

---

# [Python 2], 41 bytes

<!-- language-all: lang-python -->

 lambda a,b:bin(a^b).count(`+True`)is+True

[Try it online!][TIO-ju88ode4]

[Python 2]: https://docs.python.org/2/
[TIO-ju88ode4]: https://tio.run/##fVFBbsIwELz7FRYcbBMXxVGRUKT02Bdwi1JwElNcBcdyTBVa9e2pTUiA0tYn78zsaHZXH@2uVlFX1KVIJpNJV/F9XnLIaR7nUmH@kpN5UR@UxZtgZQ5iQ2Rz@nROnbL4gWUAiFYUGG0TFHgfAoA2Ulm4xSFlBE6hf8kTdG12dxxJRsN/yEVEo8cT/wvpfM@9jnzmVSNuSTaSPzsZZdFfndFiQe9sexaAKVyJxqlqAx3SWKkE8NOu3ZoShOZvtVsX@ozDZf6F5k625xbXpsQFIb6pgFLBfj2@zKX1gOHqVeBKKDx4ERIDOBTrbSW1FiVMRih1d7FZgEKG0hHzUJKgEGXBNRawODubXYyGrMXOYDcZHuqW0KiP2vpkH1LjWSqtMPguDclmS0IAtObowsLb8w8qx1/u6P79ltE7r2QZI2qEPjtf9KIthLax5k3TfQM "Python 2 – Try It Online"

Taking [TFeld's][1] `lambda a,b:bin(a^b).count('1')==1` and making it pristine by changing the 1's to `+True` and `==` to `is`. Thanks to Jo King for 1 byte.


 [1]: https://codegolf.stackexchange.com/a/182836/20260