On Wed, 6 Apr 2016, Bruno Grenet wrote:
to take into account the fact that 12.is_pri<tab> offers no completion
I guess this could be handled as a special case, but then we should also have 12.is_prime? and 12.is_prime??.
Would this be useful for others as a direct function of Sage? And if so, should it be available both as unitary_divisors(60) and 60.unitary_divisors()?
My two cents: It can be useful to some people so I'm in favor of adding it, but I am against "polluting" the namespace with it since it is quite specific.
More generally, I do not know if there is a general policy for putting or not some methods in the global namespace.
I think that we have no policy yet. Developer manual just says "- - listing imports from that directory that are important enough to be in the Sage’s global namespace at startup.", not saying what things are so important.
As an example: IMO KleinFourGroup() should be groups.KleinFour() just like we have graphs.PetersenGraph().
Could he have something like "import number_theory_special"? So one could kind of expose more functions to global namespace according to what one needs.
-- Jori Mäntysalo