On Thursday, May 29, 2014 12:03:54 AM UTC+1, William wrote:
>
> Another issue is that frequently in math we have algorithms/options to 
> functions, e.g., 
>   sage: a.det(algorithm="padic") 
>

And even if there is no argument I would prefer a.det() over a.det to make 
it clear that this is invoking a computation and not just accessing one of 
the defining attributes of a. This is _the_ difference between an 
argument-less method and a readonly @property: If you have to call() it, it 
is clear that there is a computation involved. Whereas a single property 
invites you to tab-complete your way through it a.det.is_prime, and you 
don't want to run a computation every time you press tab.

There is an argument to be made for using @property to access the defining 
data of an object, but since we historically don't do it I would prefer 
consistency over that syntactic gadget. The benefit of not having to always 
type () vs. the continual uncertainty about whether you need parentheses... 
In Sage, there are generally a lot of methods computing stuff compared to 
the simple accessor methods needed, so there isn't much need for @property 
to start with. 

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to