Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max(x, y).is_Function but isinstance(Max(x, y), Function) is False #14242

Open
smichr opened this issue Feb 16, 2018 · 5 comments
Open

Max(x, y).is_Function but isinstance(Max(x, y), Function) is False #14242

smichr opened this issue Feb 16, 2018 · 5 comments

Comments

@smichr
Copy link
Member

smichr commented Feb 16, 2018

Is there a reason for these functions to not appear as Function? (They are Application type.)

@jashan498
Copy link
Member

Being Application type makes Max(x, y).is_Function = True but Max is not inherited from Function that is why isinstance(Max(x, y), Function) is False

@smichr smichr changed the title Max(x, y).is_Function and isinstance(Max(x, y), Function) are False Max(x, y).is_Function but isinstance(Max(x, y), Function) is False Feb 18, 2018
@smichr
Copy link
Member Author

smichr commented Feb 18, 2018

Other than making Max inherit from Function, is there any way to make it so isinstance(Max(x, 1), Function) would be true? Is there a reason that Max doesn't inherit from Function (perhaps in addition to Application)?

@jashan498
Copy link
Member

I don't think it would be possible until Max is a subclass of Function. I have seen a similar issue here.

@jksuom
Copy link
Member

jksuom commented Feb 18, 2018

Max and Min differ from most functions in that they are restricted to the real domain. I don't know if this was the reason for not making them inherit from Function, but it might not be a bad idea to keep it that way.

@normalhuman
Copy link
Contributor

Heaviside is also restricted to real domain, but inherits from Function nonetheless.

I thought that the fact that the number of arguments of Max and Min is variable could be a factor here. But does anything actually break if the definition of Max was class Max(MinMaxBase, Function)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants