@curry
def ensure_doctest(f, name=None):
 _getframe(2).f_globals.setdefault('__test__', {})[(f.__name__ if (name is None) else name)] = f
 return f

@ curry def ensure_doctest ( f , name = None ) : _getframe ( 2 ) . f_globals . setdefault ( '__test__' , { } ) [ ( f . __name__ if ( name is None ) else name ) ] = f return f
ensure that an object gets doctested .