With Sage 5.12.beta4, I see 

sage: delsarte_bound_additive_hamming_space(11,3,4,d_star=9)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call
last)
<ipython-input-10-14fed6190a46> in <module>()
----> 1
delsarte_bound_additive_hamming_space(Integer(11),Integer(3),Integer(4),d_star=Integer(9))

/usr/local/src/sage/sage-5.12.beta4/local/lib/python2.7/site-packages/sage/misc/lazy_import.so
in sage.misc.lazy_import.LazyImport.__call__
(sage/misc/lazy_import.c:2550)()

/usr/local/src/sage/sage-5.12.beta4/local/lib/python2.7/site-packages/sage/coding/delsarte_bounds.pyc
in delsarte_bound_additive_hamming_space(n, d, q, d_star, q_base,
isinteger, return_data, solver)
    261       try:
    262         bd=p.solve()
--> 263       except sage.numerical.mip.MIPSolverException, exc:
    264         print "Solver exception: ", exc, exc.args
    265         if return_data:

NameError: global name 'sage' is not defined

OK, I should have had a doctest for this exception :-)

If I add into the function in question
  from except sage.numerical.mip import MIPSolverException
and change the except to 
  except MIPSolverException, exc:

then things work as they should.

The question: is this a lazy_import bug, or a lazy_import feature?
If it's a feature, it's an unfortunate one, as then lazily imported
things behave differently from eagerly imported ones.

Thanks,
Dima


-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to