Skip to content

Commit a26bf76

Browse files
use functools.update_wrapper to maintain wrapped function properties
1 parent cce318f commit a26bf76

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

marimo/_ast/app.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import ast
55
import base64
6+
import functools
67
import inspect
78
import sys
89
import threading
@@ -332,12 +333,15 @@ def __(mo):
332333
"""
333334
del kwargs
334335

335-
return cast(
336+
decorated_function = cast(
336337
Union[Cell, Callable[[Fn[P, R]], Cell]],
337338
self._cell_manager.cell_decorator(
338339
func, column, disabled, hide_code, app=InternalApp(self)
339-
),
340-
)
340+
))
341+
342+
functools.update_wrapper(decorated_function, func)
343+
344+
return decorated_function
341345

342346
@overload
343347
def function(self, func: Fn[P, R]) -> Fn[P, R]: ...

0 commit comments

Comments
 (0)