[Tutor] Attaching methods to class instances

Magnus Lyckå magnus@thinkware.se
Thu Jun 19 20:10:02 2003


At 16:38 2003-06-19 -0700, Zak Arntson wrote:
>The new method would ALWAYS return whatever the last value of args[key] was.
>Blech. Hence the addition of _dummy. But is there a cleaner way to do this?

I haven't looked at the deatils, but an idea I thought
about is to use class instances with a __call__ attribute
instead of methods.

I guess a typical heuristic in OO languages is, that you
should use a custom class when the builtin contructs don't
quite fit the bill...


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language