MCPcopy Create free account
hub / github.com/Singular/Singular / OMCDImplementation

Class OMCDImplementation

Singular/dyn_modules/openmath/objects.py:35–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35class OMCDImplementation(object):
36 converter=None
37 def __init__(self, cd):
38 object.__setattr__(self,"cd",cd)
39 #object.__setattr__(self,"converter",None)
40 def support(self,symbol):
41 setattr(self,symbol,OMS(symbol, self.cd))
42 def __setattr__(self, name,value):
43 if name=="converter":
44 object.__setattr__(self,name,value)
45 return
46 "FIXME: implements this later safer against name conflicts"
47 if callable(value) and (not isinstance(value, ImplementedSymbol)):
48
49 if self.converter!=None:
50 object.__setattr__(
51 self,
52 name,
53 ImplementedSymbol(
54 OMS(name,self.cd),
55 self.converter(value)))
56 else:
57 object.__setattr__(self, name, ImplementedSymbol(OMS(name,self.cd), value))
58 else:
59 object.__setattr__(self,name,value)
60
61class OMS(object):
62 def __init__(self,name,cd = None):

Callers 7

arith1.pyFile · 0.90
pseudocode.pyFile · 0.85
fieldname1.pyFile · 0.85
polyd.pyFile · 0.85
gametheory.pyFile · 0.85
primdec.pyFile · 0.85
list1.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected