the python keyword is
is supposed to be used in place of the ==
operator according to python style guides.
However they don't always do exactly the same thing as shown here. Why? What is the actual difference, and what is the proper usage?
import unittest
class testIS(unittest.TestCase):
def test_is(self):
self.assertEqual(1,1)
if __name__ == '__main__':
unittest.main()
Which works... but the following does not...
import unittest
class testIS(unittest.TestCase):
def test_is(self):
self.assertEqual(1,1)
if __name__ is '__main__':
unittest.main()