ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 03 Oct 2012 20:35:40 +0200Maps in FiniteSetMapshttps://ask.sagemath.org/question/9385/maps-in-finitesetmaps/I want to create a special function class which derives from a function, an element of FiniteSetMaps.
I am thinking it would look something like the below.
My two questions are:
1) What class should I derive this from?
2) What is the least taxing way to "initialize" this class and set it equal to the map I'm passing in.
See below. Thanks!
`
class SpecialFunction(<fill in the blank>):
def __init__(self,f):
CODE HERE TO Set self to be equal to the function f
def ColorOfFunction(self)
return "Blue" `
This is not *absolutely* necessary in what I'm implementing, though I would prefer saying `f.getcolor()` than `getcolor(f)`, as this will be useful from a namespace perspective as well.Wed, 03 Oct 2012 20:35:40 +0200https://ask.sagemath.org/question/9385/maps-in-finitesetmaps/