You can copy this line of code and test it in your Python environment:

#! /usr/bin/env python
# _*_ Coding: UTF-8 _*_
print("А"= ="A")
Copy the code

You may be surprised to find that a large False is returned.

In Python, == is used as a value comparator, unlike is, which compares whether the virtual space ids stored by objects are the same, for example:

#! /usr/bin/env python
# _*_ Coding: UTF-8 _*_
medusa_1 = [1.2.3]
medusa_2 = medusa_1
medusa_3 = [1.2.3]

print(medusa_1 == medusa_2)  # True
print(medusa_2 == medusa_3)  # True

print(medusa_1 is medusa_2)  # True
print(medusa_2 is medusa_3)  # False
Copy the code

In the code for our test, why has “A” == “а” been False? According to our analysis, the “A” == “а” should be True if the value is the same. Are the values not equal?

parsing

The two characters are not equal as the first letter looks like A (A), but it is actually A Russian initial. The two are not equal in Python, and even if you use them as variable names you may encounter undefined error messages.

See here, when you want to write code that is difficult for others to maintain, you can use this:

  • Twist words
  • usej,k,iEtc
  • Use names that are not English words
  • Deliberately misspelling letters

Of course, you might have a more advanced approach.

Obfuscate the letter correspondence table

Russian English Russian English
А A В B
Е E И N
К K М M
Н H О O
Р P С C
Т T У Y
Х X а a
Kind guide B е e
seem K м M
н H о o
р p с c
т T у y
х x
The Greek English The Greek English
Α A Β B
Ε E Ζ Z
Η H Ι I
Κ K Μ M
Ν N Ο O
Ρ P Τ T
Υ Y Χ X
gamma y κ K
argument v &western o
rho p χ X




The heart must live a small devil 😈