# More Python Madness
The "==" operator calls "__eq__". The "!=" operator calls "__ne__", NOT "not __eq__". In fact, the two have no relationship at all!
Wednesday, September 27, 2006
The "==" operator calls "__eq__". The "!=" operator calls "__ne__", NOT "not __eq__". In fact, the two have no relationship at all!
Wednesday, September 27, 2006
$ python >>> class TestClass: ... def __init__(self): ... self.x = "X" ... def __str__(self): ... return self.x ... >>> test = TestClass() >>> str(test) 'X' >>> test_list = [TestClass(), TestClass(), TestClass()] >>> test_list [<__main__.TestClass instance at 0xb7d1a4ec>, <__main__.TestClass instance at 0xb7d1a50c>, <__main__.TestClass instance at 0xb7d1a52c>] >>> str(test_list) '[<__main__.TestClass instance at 0xb7d1a4ec>, <__main__.TestClass instance at 0xb7d1a50c>, <__main__.TestClass instance at 0xb7d1a52c>]' >>> print test_list [<__main__.TestClass instance at 0xb7d1a4ec>, <__main__.TestClass instance at 0xb7d1a50c>, <__main__.TestClass instance at 0xb7d1a52c>] >>> print test_list[0] 'X'
list.__str__() calls __repr__() on each item, not __str__()???!!!
Wednesday, September 27, 2006
Stages of Windows Mastery:
Sunday, September 17, 2006
Front page link to THIS??? Probably the worst article on programming languages ever written.
'Most argue that VB.Net is currently more popular than ever and one of the only "must-learns."'. Purrrlease!
Saturday, September 16, 2006