Re:Things I Wish I Had Known About Django Development Before...
by danellis on Wednesday April 17, 2013 @10:00PM
(#5568541)
__complex__ is for converting to a complex number.
Re:Things I Wish I Had Known About Django Development Before...
by davesque on Thursday April 18, 2013 @12:55AM
(#5568961)
yeah, danellis is right. don't use __complex__ for that. it's for complex numbers:
http://docs.python.org/2/library/functions.html#complex --and-- http://docs.python.org/2/library/cmath.html
The way to deal with is __complex__ as a method on the object and recurse through asking the complex method to return nested simpler python types.