Changes between Version 1 and Version 2 of Ticket #18416, comment 3


Ignore:
Timestamp:
Mar 21, 2013, 11:44:38 AM (11 years ago)
Author:
dougvanhorn

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18416, comment 3

    v1 v2  
    1313It's the `value is None` that causes the problem.  [http://stackoverflow.com/questions/15399024/does-the-is-operator-use-a-magic-method-in-python It's an identity test].
    1414
    15 If the intent of the if-test is to return `None` when the supplied value equates to `None`, then the if-test should be re-written as `value == None`, which would test for equality.  The equality test is slower, though, so you'll likely find argument against using it in this section of the code.  Oddly built objects with __eq__ overloaded might also find trouble.
     15If the intent of the if-test is to return `None` when the supplied value equates to `None`, then the if-test should be re-written as `value == None`, which would test for equality.  The equality test is slower, though, so you'll likely find argument against using it in this section of the code.  Oddly built objects with `__eq__` overloaded might also find trouble.
    1616
    1717So there may not be much to do here, leaving the burden on the user to figure out what's going on.  But I wanted to add some documentation to this bug for future reference.
Back to Top