I'm able to do this:
sage: f = function('radius', nargs=1, evalf_func=Graph.radius)
sage: f(graphs.HouseGraph())
2
But not this:
sage: var('G')
sage: expr = f(G)
sage: expr.subs(G=graphs.HouseGraph())
...
TypeError: no canonical coercion from <class 'sage.graphs.graph.Graph'> to
Symbolic Ring
What am I missing? Is it not possible to use symbolic expressions like
this? I want to dynamically build lots of different expressions with many
operations, and then later evaluate them for different Graph (as well as my
own class that inherits from Graph) objects.
Thanks for any help.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.