Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think I know what happened. I don't know if it should be considered user error or a bug.

Look at the code in question.

sage: [u02-1]
[u02 - 1]
sage: isinstance(u02-1,tuple)
False
sage: isinstance(u02-1,list)
False
sage: function_type=type(lambda x,y: x+y)
sage: function_type
<type 'function'>
sage: isinstance(u02-1,function_type)
False

And clearly it's not None, so the if/elif never actually gives min a value. Also notice that all the examples use lambda functions for their cons values.

Since cons "This should be either a function or list of functions that must be positive", perhaps just having a symbolic expression is not enough. After all, who knows what the variable is to be? But maybe we should have a better error check for this?