Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 12 years ago

SLOtoSF gravatar image

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"
click to hide/show revision 2
No.2 Revision

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"
"Blue" `

This is not absolutely necessary in what I'm implementing, though I would much rather prefer saying f.getcolor() than getcolor(f), as this will be useful from a namespace perspective as well.

click to hide/show revision 3
No.3 Revision

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 much rather prefer saying f.getcolor() than getcolor(f), as this will be useful from a namespace perspective as well.