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

Commit 44e80b3

Browse files
committed
EvaluationMethods should be a new-style class
1 parent 0c1f89f commit 44e80b3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/sage/functions/hypergeometric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def _tderivative_(self, a, b, z, *args, **kwargs):
351351
return (t * derivative(z, diff_param) *
352352
hypergeometric([c + 1 for c in a], [c + 1 for c in b], z))
353353

354-
class EvaluationMethods:
354+
class EvaluationMethods(object):
355355
def _fast_float_(cls, self, *args):
356356
"""
357357
Do not support the old ``fast_float``.

src/sage/functions/piecewise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def simplify(ex):
283283
raise NotImplementedError
284284

285285

286-
class EvaluationMethods:
286+
class EvaluationMethods(object):
287287

288288
def expression_at(cls, self, parameters, variable, point):
289289
"""

src/sage/symbolic/expression.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ from __future__ import print_function, absolute_import
137137

138138
include "cysignals/signals.pxi"
139139

140+
from inspect import ismethod
140141
import operator
141142
from . import ring
142143
import sage.rings.integer
@@ -11754,7 +11755,7 @@ cdef get_dynamic_class_for_function(unsigned serial):
1175411755
....: def __init__(self):
1175511756
....: BuiltinFunction.__init__(self, 'tfunc', nargs=1)
1175611757
....:
11757-
....: class EvaluationMethods:
11758+
....: class EvaluationMethods(object):
1175811759
....: def argp1(fn, self, x):
1175911760
....: '''
1176011761
....: Some documentation about a bogus function.
@@ -11799,7 +11800,7 @@ cdef get_dynamic_class_for_function(unsigned serial):
1179911800
....: def __init__(self):
1180011801
....: BuiltinFunction.__init__(self, 'tfunc', nargs=2)
1180111802
....:
11802-
....: class EvaluationMethods:
11803+
....: class EvaluationMethods(object):
1180311804
....: def argsum(fn, self, x, y):
1180411805
....: return x + y
1180511806
....:
@@ -11820,13 +11821,12 @@ cdef get_dynamic_class_for_function(unsigned serial):
1182011821
from sage.symbolic.function_factory import eval_on_operands
1182111822
from sage.structure.misc import getattr_from_other_class
1182211823
for name in dir(eval_methods):
11823-
m = getattr(eval_methods(), name)
11824-
if callable(m):
11824+
if ismethod(getattr(eval_methods, name)):
1182511825
new_m = eval_on_operands(getattr_from_other_class(
1182611826
func_class, eval_methods, name))
1182711827
setattr(eval_methods, name, new_m)
1182811828
cls = dynamic_class('Expression_with_dynamic_methods',
11829-
(Expression,), eval_methods)
11829+
(Expression,), eval_methods, prepend_cls_bases=False)
1183011830
else:
1183111831
cls = Expression
1183211832

0 commit comments

Comments
 (0)