On Friday, January 8, 2016, Vincent Delecroix <20100.delecr...@gmail.com>
wrote:

> That would still expose the method in the namespace. Having "2" or
> "log(2)" not being symbolic constant is confusing! I would definitely
> prefer an "_is_symbolic_constant".


A confusing name not in the global namespace isn't much better.  How about
a rename that is clearer?   Ideas

   is_named_constant
   is_famous_constant
   is_special_constant


I like special in that this is sort of like a special function.




>
> On 08/01/16 16:20, Volker Braun wrote:
>
>> Maybe it should be renamed to .is_symbolic_contstant(), freeing up
>> .is_constant() for you.
>>
>>
>> On Friday, January 8, 2016 at 6:16:38 PM UTC+1, Daniel Krenn wrote:
>>
>>>
>>> Dear all,
>>>
>>> from the method-name and also from the one-line description
>>>      "Return True if this symbolic expression is a constant."
>>> of Expression.is_constant, I expected that this gives more or less the
>>> same result as checking whether symbolic expression has an empty
>>> .variables(). However, we have
>>>     sage: log(2).is_constant()
>>>     False
>>> and also
>>>     sage: SR(2).is_constant()
>>>     False
>>> only pi, e and that stuff is "constant".
>>> I find this very confusing. Am I alone with this feeling?
>>>
>>> The above is also inconsistent to
>>>     sage: P.<p> = ZZ[]
>>>     sage: P(2).is_constant()
>>>     True
>>>
>>> Best wishes,
>>>
>>> Daniel
>>>
>>> PS: To be fair, after the one-line description, it is explained what it
>>> really does:
>>>     This function is intended to provide an interface to query the
>>>     internal representation of the expression. In this sense, the word
>>>     "constant" does not reflect the mathematical properties of the
>>>     expression. Expressions which have no variables may return "False".
>>> But the phrase "the internal representation of the expression" sounds
>>> like the end user should not care about it... (i.e. this is_constant
>>> could be an underscore-method...).
>>>
>>> PPS: At the moment (not having answers to this posting), my favourite
>>> implementation would be something like
>>>     def is_constant(self):
>>>         return not self.variables()
>>>
>>>
>>
> --
> 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.
>


-- 
Sent from my massive iPhone 6 plus.

-- 
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