diff --git a/pony/orm/sqltranslation.py b/pony/orm/sqltranslation.py index 11d41c05..0efd7b21 100644 --- a/pony/orm/sqltranslation.py +++ b/pony/orm/sqltranslation.py @@ -10,7 +10,7 @@ from uuid import UUID from pony import options, utils -from pony.utils import localbase, is_ident, throw, reraise, copy_ast, between, concat, coalesce +from pony.utils import localbase, is_ident, throw, reraise, copy_ast, between, concat, coalesce, HashableDict from pony.orm.asttranslation import ASTTranslator, ast2src, TranslationError, create_extractors, get_child_nodes from pony.orm.decompiling import decompile, DecompileError, operator_mapping from pony.orm.ormtypes import \ @@ -2657,7 +2657,7 @@ def __call__(monad, *args, **kwargs): name_mapping = inspect.getcallargs(monad.func, *(monad.params + args), **kwargs) func = monad.func - func_id = id(func) + func_id = HashableDict(code=id(func.__code__), func=id(func)) try: func_ast, external_names, cells = decompile(func) except DecompileError: