arvydas / blinkstick-python

BlinkStick Python interface to control devices connected to the computer
Other
136 stars 53 forks source link

Compare strings with `==` not `is` #38

Closed np closed 8 years ago

np commented 8 years ago

For instance:

>>> r = ''.join(['r','a','n','d','o','m'])
>>> r == 'random'
True
>>> r is 'random'
False
>>> intern(r) is 'random'
True

Meanwhile, the workaround is to call intern on the given string. For instance:

>>> led.pulse(name=intern(r))
arvydas commented 8 years ago

Thanks for the pull request and spotting this issue!