On Friday, July 1 at 19:17 (-0700), bdb112 said:
> Question: > Can I replace the builtin sum function globally for test purposes so > that my large set of codes uses the replacement? > > The replacement would simply issue warnings.warn() if it detected an > ndarray argument, then call the original sum > I could then find the offending code and use the appropriate import to > get numpy.sum You shouldn't do this, but you could use the __builtins__ module e.g. >>> __builtins__.sum = numpy.sum # bad -- http://mail.python.org/mailman/listinfo/python-list