[Numpy-discussion] Where does _assert_func come from.
Charles R Harris
Thu Aug 28 20:39:02 CDT 2008
On Thu, Aug 28, 2008 at 6:48 PM, Fernando Perez <email@example.com>wrote:
> On Thu, Aug 28, 2008 at 5:26 PM, Charles R Harris
> <firstname.lastname@example.org> wrote:
> > Where does _assert_func come from in this fragment from a test class?
> > class _GenericTest(object):
> > def _test_equal(self, a, b):
> > self._assert_func(a, b)
> > I hope it isn't monkey patched in.
> It could be meant as a mix-in, case in which it would be ok for the
> class to be incomplete as written. A bit surprising, but not
> necessarily incorrect.
> If it's not meant to be a base/mix-in class, then it's a good ole'bug.
Turns out it's defined in a derived class, which I suppose makes it a mix-in
class. Looks kinda like the python version of pure virtual functions in C++
base classes. It's a bit surprising to see a python pattern that's more
obscure than C++ ;) I'm not sure I like its usage here -- implementation
rather than is a -- but I'm not going to clean it up.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion