Open ahagmann83 opened 10 months ago
Are you able to use the function after defining it? In the same cell or another cell?
The type shown in the cell is the type of value in the cell.
A function can't be shown as a value really, unless executed. So even though it might be better to say "Function", I think it still works.
Try putting this under the function in the same cell:
type(myfunc).__name__
You can do something like this to create shared logic.
=PY( def mysum(a, b): return a + b mysum(1,3)
As @ncalm mentioned about, you need to execute that function from within a Python formula. You can also make calls to that function from other python formulas, provided they come after the initial declaration in row-major-order.
One thing to note, is we will be allowing the Initialization pane for editing, so you will be able to store your functions there and call them.
When will that be released (editable initialization pane)?
How can I define a Python function object? I tried to define a Python function in a PY Cell with def myfunc():, but it returned a NoneType Object.