mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-04 15:00:02 -04:00
be5d326343
and also addresses a significant chunk of py3k deprecations. It's mainly expicit __hash__ methods. Additionally, most usage of sets/dicts to store columns uses util-based placeholder names.
14 lines
278 B
Python
14 lines
278 B
Python
import types
|
|
|
|
__all__ = '_function_named',
|
|
|
|
|
|
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
|
|
|