On 2017-09-16 03:31, Nils Bruin wrote:
So if you're finding you can't put a "from A import a" at the top-level and using it locally has noticeable cost (which can easily happen: imports have a significant cost, even for modules that are already present), then you could try to do a straight import and access the appropriate namespace.
But accessing the namespace is also slower than doing the "from ... import ..." import:
sage: x = 42 sage: timeit("sage.structure.element.parent(x)", number=20, repeat=10^6) 20 loops, best of 1000000: 143 ns per loop sage: timeit("parent(x)", number=20, repeat=10^6) 20 loops, best of 1000000: 47.7 ns per loop -- 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.