not compatible with py3k. I can run all tests or any combination of tests
by using sqlalchemy.util so it's not clear to me why sqlalchemy.util
reportedly cannot be imported at this phase.
-import types
-import __builtin__
__all__ = '_function_named', 'callable'
-
-def _function_named(fn, newname):
- try:
- fn.__name__ = newname
- except:
- fn = types.FunctionType(fn.func_code, fn.func_globals, newname,
- fn.func_defaults, fn.func_closure)
- return fn
-
-try:
- from __builtin__ import callable
-except ImportError:
- callable = lambda x: hasattr(x, '__call__')
+from sqlalchemy.util import callable, function_named as _function_named