13 Nov 2010 01:34
Re: Re: Function next_prime using with cython
Mitesh Patel <qed777 <at> gmail.com>
2010-11-13 00:34:32 GMT
2010-11-13 00:34:32 GMT
On 11/12/2010 03:17 PM, Robert Bradshaw wrote: > On Fri, Nov 12, 2010 at 7:56 AM, karneades <apo <at> pdauf.de> wrote: >> On 12 Nov., 15:50, Mitesh Patel <qed... <at> gmail.com> wrote: >>> On 11/12/2010 08:35 AM, karneades wrote: >>> What happens if you prepend >>> >>> from sage.rings.arith import next_prime >>> from sage.misc.misc import cputime >>> >> Thank you Mitesh Patel, >> >> this works. >> >> Any hints, where i can find more information for this necessery >> imports? > > You get a NameError telling you what functions you need to import. To find the module paths of the missing functions, I used introspection, e.g., next_prime?<TAB> and checked the "File:" field. But William's and Robert's suggestions seem much more convenient. > (Either that or a typo.) Now that cython has import *, perhaps we > should do a "from sage.all import *" at the top. Even better would be > to use http://wiki.cython.org/enhancements/inline which automatically(Continue reading)
RSS Feed