Maps in FiniteSetMaps

asked 2012-10-03 20:35:40 +0100

SLOtoSF gravatar image

updated 2012-10-03 23:23:32 +0100

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.

edit retag flag offensive close merge delete