Details
-
Type:
Bug
-
Status: To Do
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Story Points:0.5
-
Epic Link:
-
Team:Data Release Production
Description
lsst.afw.image.image.image.ImageF has no __idiv__ method defined, so if one tries to do im \= value without having done from __future__ import division (which makes /= point to __itruediv__, then an AttributeError gets raised. Other undesired operators (e.g., __add__, __mul__) raise NotImplementedError, which seems more appropriate. Possible solutions would be to either have __idiv__ raise NotImplementedError (with a helpful message suggesting to please do the __future__ import) or to redirect __idiv__ to __itruediv__.
Not having __idiv__ was a deliberate design choice (although I forgot which RFC mandated that). I wonder why there is a difference in the raised error though. We should check what the standard behaviour should be and perhaps modify this upstream.