# field extensions in python

You can define a field extenion at the sage prompt with

```
QC.<j>; = QQ.extension(x^2+1)
```

however this same line in a python script yields a syntax error

```
def mytest():
QC.<j> = QQ.extension(x^2+1);
return
Traceback (most recent call last):
...
def mytest(): QC.<j> = QQ.extension(x**_sage_const_2 +_sage_const_1 ); return
^
SyntaxError: invalid syntax
```

Note:syntax error point to < character

eval also fails

```
eval('QC.<j> = QQ.extension(x^2+1)')
Traceback (most recent call last):
....
QC.<j> = QQ.extension(x^2+1)
^
SyntaxError: invalid syntax
```

I also have similar problems with defining Quaternion Algebras in python

```
HQ.<q1,q2,q3> = QuaternionAlgebra(QC,-1,-1)
```

so why does QC.<j> = QQ.extension(x^2+1) work at the sage prompt and not in python or with eval(string)

Thanks, Steve