Which results in Bn.__init__ serving arbitrary objects to abs(). According to the doc, the following types are acceptable:
"The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned."
You could either make Bn be an int or float, make its constructor explicitely reject wrong input types, or build a copy constructor (is that even a thing in Python!?).
Which results in
Bn.__init__
serving arbitrary objects toabs()
. According to the doc, the following types are acceptable:You could either make
Bn
be anint
orfloat
, make its constructor explicitely reject wrong input types, or build a copy constructor (is that even a thing in Python!?).