On Saturday, October 29, 2011 2:57:54 PM UTC+2, Simon King wrote: > > Hi Maarten, > > On 29 Okt., 12:59, Maarten Derickx <m.derick...@gmail.com> > wrote: > > (2) means: We have best speed and we have documentation, but the > method carrying the documentation is not used internally. > > +1
> > And even more important it allows > > for tab completion in ipython as shown below. > > That's exactly the same for lazy attributes. > > I know, this is since lazy attributes are descriptors just as properties. > > I would find this tabcompletion very usefull for certain properties > since I > > have often done something like: > > tmp = Object.method_wich_could_be_an_attribute() > > just to be able to have tab completion on tmp to see if it allowed me to > do > > with it what I want. > > When you do tmp = b.some_property, followed by tmp?, then you see the > documentation of the return value of b.some_property. > I was talking about tab completion. I now see that I explained my ideas slightly short and cryptic. What I meant to say I is that it is nice to be able to do l.hello.p<tab> like in the example I posted above. This is possible with all __get__ descriptors (so with lazy attributes and properties for example). > > Is that really what you want to see? Then you are arguing *against* > the use of properties, because b.some_property? will show you the > documentation of the property itself (not of its return value). > > If you do b.some_lazy_attribute?, then you will see the documentation > of the return value (which I don't like). > > If you do b.some_cached_method? then you will see the documentation of > the function that returns the value, and of course > b.some_cached_method()? won't work. > > Best regards, > Simon > -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org