id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	work_issues	upstream	reviewer	author	merged	dependencies	stopgaps
11797	Finite field elements are allowed in exponents	nbruin	AlexGhitza	"{{{
sage: p=7
sage: k=GF(p)
sage: k(2)^k(p)
1
sage: (GF(7)(2))^(GF(5)(2))
4
sage: k(2)^p
2
}}}
It looks like it's simply quietly lifting the exponent to the integers, which it shouldn't do because there is no coercion in that direction (only a conversion):
{{{
sage: k.<a>=GF(p^2)
sage: k(2)^k(p)
1
sage: k(2)^k(a)
TypeError: not in prime subfield
sage: ZZ(k(1))
1
sage: ZZ(k(a))
TypeError: not in prime subfield
}}}
There is one side-effect of this that does look elegant:
{{{
sage: R=Integers(p-1)
sage: (k(2))^(R(p))
2
}}}
but in general I'd say an error should result from exponentiations like this."	defect	new	major	sage-5.10	basic arithmetic					N/A					
