> When there are several names, I think we should return the one that > agrees with the name that was given by the user.
I really don't know how we can obtain the name used inside the function. We should somewhat access the stack of calls of the console (as the calls import_statement(CachedFunction) and import_statements(cached_function) are semantically the same). What you would expect from the following non-examples sage: z_not_ZZ = ZZ sage: import_statements(z_not_ZZ) and the trickier sage: import_statements(1) and the even trickier sage: f = lambda x: return cached_function sage: import_statements(f()) > remove sage.all from the list of modules. > If someone wants to import ZZ, they should not do it with: > > from sage.all import ZZ > > but instead with > > from sage.integer_ring import ZZ We can add an exception for it (and even remove sage.all from the list of modules ?). But then, why is there ZZ = IntegerRing() in the file all.py? Simply removing sage.all from the available modules leads to sage: import_statements(ZZ) from sage.coding.linear_code import ZZ More generally, there are many files where it is written "ZZ = IntegerRing()". I think this should be avoided. Are there some coding coventions about instanciations within modules? Best, Vincent -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.