Remove abuse of predefined x in doctests
Closed this issue · 4 comments
mkoeppe commented
For example in src/sage/rings/number_field/number_field.py
sage: K.<a> = NumberField(x^2 - 2)
This leads to numerous errors when sage.symbolic is not available (#32601).
Component: refactoring
Issue created by migration from https://trac.sagemath.org/ticket/32721
slel commented
comment:3
Many NumberField and FiniteField definitions
use a polynomial in x.
The corresponding documentation examples
would be improved by first defining x as:
sage: x = polygen(ZZ)
slel commented
comment:4
Many calculus and plotting examples use a symbolic variable x.
The corresponding documentation examples
would be improved by first defining x as:
sage: x = SR.var('x')
mkoeppe commented
comment:5
Perhaps, but that's not in the scope of this ticket.