Also fix the following:
sage: NF.<a> = QuadraticField(-2)
sage: CIF(a)
...
ValueError: can not convert complex algebraic number to real interval
We also deal with Python 3 compatibility regarding int/long and bytes/unicode.
Depends on #24423
CC:  @tscrim
Component: coercion
Author: Jeroen Demeyer
Branch/Commit: 9ac1612
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/24371