Dear Johan,

Thanks a lot, this is very helpful. And I agree that a deprecation warning 
would have been appropriate and also that keeping the trait_names() method 
active would help me at least. The problem with the _tab_completion() 
method is that it is not easily discoverable, as it does not show up when 
typing units.energy.<tab>. Ironic, isn't it?

Cheers
Stan

On Wednesday, July 6, 2016 at 1:50:08 AM UTC+2, Johan S. R. Nielsen wrote:
>
> Hi Stan, 
>
> It seems that trait_names() was originally added as part of a mechanism 
> for giving tab-completion to certain objects in IPython and the 
> Notebook, and this mechanism changed. Hence what used to be 
> trait_names() is now called _tab_completion() -- at least 
> units.energy._tab_completion() does exactly what 
> units.energy.trait_names() used to do, after #20410. You should be able 
> to change your existing code to use that instead. 
>
> But since trait_names() was a public API method, there should have 
> definitely been added a deprecation warning in #20410 instead of just 
> simply removing trait_names. Also, it seems the function is useful from 
> some user-perspectives, such as your own, so perhaps there should be a 
> publicly accessible version of _tab_completion() as well? 
>
> Best, 
> Johan 
>
>
> Stan writes: 
>
> > Dear all, 
> > 
> > After upgrading to 7.2, I found out that things such as 
> > units.energy.trait_names() do not work any more. I used this extensively 
> to 
> > loop through the different unit names and create variable names out of 
> > them. Why was this removed, and is there another way of doing this? I 
> want 
> > to be able to write e.g. 'joule' instead of 'units.energy.joule'. I 
> found a 
> > couple of tickets that may have led to the removal of trait_names for 
> units 
> > (see below), but I don't understand why, and how I can make my old 
> > worksheets compatible with sage 7.2! 
> > 
> > https://trac.sagemath.org/ticket/20410 
> > https://trac.sagemath.org/ticket/19951 
> > 
> > Thanks already for your help. 
> > 
> > Cheers 
> > Stan 
>
>
> -- 
>

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