I got it working; the problem happened if I tried to do the import at the top of the file.  But inside the function, like was done already in continued_fraction_periodic, it's fine.

I should/will close this PR and re-open it, because I mistakenly did the work in my master branch.  Oops.

Thanks again.