On Tuesday, May 22, 2012 12:33:17 AM UTC+8, P Purkayastha wrote:
>
>
>
> On Monday, May 21, 2012 3:12:13 PM UTC+8, Robert wrote:
>>
>> On both my own copy of sage (v 4.6) and on 
>
> sagenb.org 
>
> (v 4.8), executing 
>>
>> R = QQ['a']['x']
>> R('a')
>>
>> returns 'a' as an element of R, but executing
>>
>> R = QQ['a']['x,y']
>> R('a')
>>
>> throws "TypeError: unable to convert string" (full traceback below).  Is 
>> this how it's supposed to work?
>>
>> Traceback (most recent call last):
>>
>>   File "<stdin>", line 1, in <module>
>>   File "_sage_input_3.py", line 10, in <module>
>>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
>> -*-\\n" + 
>> _support_.preparse_worksheet_cell(base64.b64decode("QSA9IFFRWydhJ10KQiA9IEFbJ3gseSddCkIoJ2EnKQ=="),globals())+"\\n");
>>  execfile(os.path.abspath("___code___.py"))
>>   File "", line 1, in <module>
>>     
>>   File "/tmp/tmpRxt973/___code___.py", line 4, in <module>
>>     exec compile(u"B('a')" + '\n', '', 'single')
>>   File "", line 1, in <module>
>>     
>>   File 
>> "/sagenb/sage_install/sage-4.8-sage.math.washington.edu-x86_64-Linux/local/lib/python2.6/site-packages/sage/rings/polynomial/multi_polynomial_ring.py",
>>  line 459, in __call__
>>     raise TypeError, "unable to convert string"
>> TypeError: unable to convert string
>>
>>
>>
> If you want the variables you can do R.gens(). If you want the generators 
> for the base ring then, R.base_ring().gens() will return you a.
>

Sorry, I misunderstood the question. This does look like a bug to me. 

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to