Re: compile error when using override

2016-12-02 Thread Ho Yeung Lee
from __future__ import division from sympy import * x, y, z, t = symbols('x y z t') k, m, n = symbols('k m n', integer=True) f, g, h = symbols('f g h', cls=Function) class AA(object): @staticmethod def __additionFunction__(a1, a2): return a1*a2 #Put what you want instead

Re: compile error when using override

2016-12-01 Thread Steve D'Aprano
On Fri, 2 Dec 2016 01:35 pm, Ho Yeung Lee wrote: > from __future__ import division > import ast > from sympy import * > x, y, z, t = symbols('x y z t') > k, m, n = symbols('k m n', integer=True) > f, g, h = symbols('f g h', cls=Function) > import inspect Neither ast nor inspect is used. Why

Re: compile error when using override

2016-12-01 Thread Ho Yeung Lee
from __future__ import division import ast from sympy import * x, y, z, t = symbols('x y z t') k, m, n = symbols('k m n', integer=True) f, g, h = symbols('f g h', cls=Function) import inspect def op2(a,b): return a*b+a class AA(object): @staticmethod def

Re: compile error when using override

2016-12-01 Thread Steve D'Aprano
On Thu, 1 Dec 2016 05:26 pm, Ho Yeung Lee wrote: > import ast > from __future__ import division That's not actually your code. That will be a SyntaxError. Except in the interactive interpreter, "__future__" imports must be the very first line of code. > class A: >     @staticmethod >     def

compile error when using override

2016-11-30 Thread Ho Yeung Lee
import ast from __future__ import division from sympy import * x, y, z, t = symbols('x y z t') k, m, n = symbols('k m n', integer=True) f, g, h = symbols('f g h', cls=Function) import inspect class A: @staticmethod def __additionFunction__(a1, a2): return a1*a2 #Put what