One advantage of properties over methods is that they autocomplete S. * Johan S. R. Nielsen <santaph...@gmail.com> [2016-04-27 13:22:57]:
> > Would it be feasible to let properties return some kind of "Undefined" > > or "NotImplemented" or "None", rather than throwing an exception? > > That would side-step the entire purpose of exceptions: catching errors > fast and where they occur. This is extremely bad for debugging, and yet > another source of inconsistency that we should definitely not be > teaching our prospective Sagesters. > > And the benefit of this sidestepping is to omit an empty pair of > parentheses? > > > - I am -1 to deprecate properties in general (here I include lazy > > attributes, which I find handy). > > Can you give me an example of a handy lazy attribute, to make it > concrete for me? > > Essentially, I find the use of properties to go directly against a > general pattern in Sage (and OOP): that private fields are only > accessible through methods. For instance, there is no Matrix.nrows -- > there is Matrix.nrows(). Why is this not a property? Consistency! In > sage.coding, we also recently refactored everything so that length, > dimension, etc. of a code is private fields, publicly accessible through > method calls. Everywhere I look in Sage, we have methods, not > properties. Why should these four examples in Matrix be so special? > > Best, > Johan > > -- > 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. -- 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.