Hi Daniel,

On 2017-07-14, Daniel Krenn <kr...@aon.at> wrote:
>>> R.<x,y> = PolynomialRing(QQ, 'lex')
>> That's not what you want.
>> [...]
>> Instead you have to do
>>   sage: R.<x,y> = PolynomialRing(QQ, order='lex')
>> (i.e., specify what parameter is 'lex' being assigned to)
>
> What does the polynomial ring constructor do with the 'lex' in the first
> example? Why is no error raised?

The preparser translates it into
  R = PolynomialRing(QQ, 'lex', names=('x', 'y',)); (x, y,) = R._first_ngens(2)

And we have the following function head:
def PolynomialRing(base_ring, arg1=None, arg2=None,
                   sparse=False, order='degrevlex',
                   names=None, name=None,
                   var_array=None,
                   implementation=None):

So, "lex" ends up in "arg1". Unfortunately, the documentation of
the PolynomialRing constructor is not very clear about what happens
with arg1. But in the source code, I find that arg1 is used to override the
parameter `name` (not `names`). However it seems that if both `name` and `names`
is present then the value of `name` has no effect. Let's try:

  sage: PolynomialRing(QQ, name='lex', names=('x','y'))
  Multivariate Polynomial Ring in x, y over Rational Field
  sage: _.term_order()
  Degree reverse lexicographic term order

Cheers,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to