Ask Your Question

Revision history [back]

This is definitely a bug, thanks for reporting! As you can see in the source code:

sage: QQbar.__contains__??

the test:

 `elif EQ:`

which corresponds to:

sage: bool(I == QQbar(I))

leads to:

TypeError: unsupported operand parent(s) for +: 'Number Field in I with defining polynomial x^2 + 1' and 'Algebraic Field'

which is catched to return False.

I have opened trac ticket 24209 for this.

This is definitely a bug, thanks for reporting! As you can see in the source code:

sage: QQbar.__contains__??

the test:

 `elif EQ:`
elif EQ:

which corresponds to:

sage: bool(I == QQbar(I))

leads to:

TypeError: unsupported operand parent(s) for +: 'Number Field in I with defining polynomial x^2 + 1' and 'Algebraic Field'

which is catched to return False.

I have opened trac ticket 24209 for this.

This is definitely a bug, thanks for reporting! As you can see in the source code:

sage: QQbar.__contains__??

the test:

 elif EQ:

which corresponds to:

sage: bool(I == QQbar(I))

leads to:

TypeError: unsupported operand parent(s) for +: 'Number Field in I with defining polynomial x^2 + 1' and 'Algebraic Field'

which is catched to return False.

I have opened trac ticket 24209 for this.

EDIT This issue is fixed now (Sage 9.4-beta3):

sage: sqrt(-1) in QQbar                                                                                                                                                                                      
True
sage: I in QQbar                                                                                                                                                                                             
True