[Wisp-cvs] wisp/users/dig tran.py,1.34,1.35
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-22 10:36:51
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv20670 Modified Files: tran.py Log Message: let Symbol_Literal inherit from Summable Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- tran.py 22 Apr 2003 10:24:03 -0000 1.34 +++ tran.py 22 Apr 2003 10:36:45 -0000 1.35 @@ -43,7 +43,7 @@ return 'Integer_Literal(%i)' % long(this) def get_scalar (this): return long(this) -class Symbol_Literal (str, Stackable): +class Symbol_Literal (str, Stackable, Summable): def __new__ (cls, s): return str.__new__(cls, s) def __repr__ (this): @@ -56,6 +56,8 @@ if not isinstance(this, Constant_Sum): this = Constant_Sum(this) if not isinstance(that, Constant_Sum): that = Constant_Sum(that) return this - that + def get_pos_symbols (this): + return this, class Unique (object): def __init__ (this, name): |