Skip to content

Make Function.func the class, as in SymPy - #542

Closed
isuruf wants to merge 1 commit into
symengine:mainfrom
isuruf:function-func
Closed

isuruf wants to merge 1 commit into
symengine:mainfrom
isuruf:function-func

Conversation

@isuruf

@isuruf isuruf commented Dec 3, 2026

Copy link
Copy Markdown
Member

Function.func was a method that rebuilt the node through the module function named after the class in lowercase, so floor(x).func was never floor, and KroneckerDelta and LambertW, which have no such module function, could not be rebuilt at all. It is now a property returning the class, whose constructor every function class shares with func.

An undefined function's func is the function itself, an UndefFunction, which now has a __name__ and compares by name, as SymPy's f(x).func is f. A PyFunction's func rebuilds the wrapped object through its own func, so that replace, subs and func keep it a PyFunction of the same class instead of turning it into an undefined function.

🤖 Generated with Claude Code

Function.func was a method that rebuilt the node through the module
function named after the class in lowercase, so floor(x).func was never
floor, and KroneckerDelta and LambertW, which have no such module
function, could not be rebuilt at all. It is now a property returning
the class, whose constructor every function class shares with func.

An undefined function's func is the function itself, an UndefFunction,
which now has a __name__ and compares by name, as SymPy's f(x).func is
f. A PyFunction's func rebuilds the wrapped object through its own func,
so that replace, subs and func keep it a PyFunction of the same class
instead of turning it into an undefined function.
@isuruf isuruf closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant