Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
EvaluationMethods should be a new-style class
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Jun 14, 2016
1 parent 0c1f89f commit 44e80b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/sage/functions/hypergeometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def _tderivative_(self, a, b, z, *args, **kwargs):
return (t * derivative(z, diff_param) *
hypergeometric([c + 1 for c in a], [c + 1 for c in b], z))

class EvaluationMethods:
class EvaluationMethods(object):
def _fast_float_(cls, self, *args):
"""
Do not support the old ``fast_float``.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/functions/piecewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def simplify(ex):
raise NotImplementedError


class EvaluationMethods:
class EvaluationMethods(object):

def expression_at(cls, self, parameters, variable, point):
"""
Expand Down
10 changes: 5 additions & 5 deletions src/sage/symbolic/expression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ from __future__ import print_function, absolute_import

include "cysignals/signals.pxi"

from inspect import ismethod
import operator
from . import ring
import sage.rings.integer
Expand Down Expand Up @@ -11754,7 +11755,7 @@ cdef get_dynamic_class_for_function(unsigned serial):
....: def __init__(self):
....: BuiltinFunction.__init__(self, 'tfunc', nargs=1)
....:
....: class EvaluationMethods:
....: class EvaluationMethods(object):
....: def argp1(fn, self, x):
....: '''
....: Some documentation about a bogus function.
Expand Down Expand Up @@ -11799,7 +11800,7 @@ cdef get_dynamic_class_for_function(unsigned serial):
....: def __init__(self):
....: BuiltinFunction.__init__(self, 'tfunc', nargs=2)
....:
....: class EvaluationMethods:
....: class EvaluationMethods(object):
....: def argsum(fn, self, x, y):
....: return x + y
....:
Expand All @@ -11820,13 +11821,12 @@ cdef get_dynamic_class_for_function(unsigned serial):
from sage.symbolic.function_factory import eval_on_operands
from sage.structure.misc import getattr_from_other_class
for name in dir(eval_methods):
m = getattr(eval_methods(), name)
if callable(m):
if ismethod(getattr(eval_methods, name)):
new_m = eval_on_operands(getattr_from_other_class(
func_class, eval_methods, name))
setattr(eval_methods, name, new_m)
cls = dynamic_class('Expression_with_dynamic_methods',
(Expression,), eval_methods)
(Expression,), eval_methods, prepend_cls_bases=False)
else:
cls = Expression

Expand Down

0 comments on commit 44e80b3

Please sign in to comment.