D
Dale Amon
There are a number of things which I have been used
to doing in other OO languages which I have not yet
figured out how to do in Python, the most important
of which is passing method names as args and inserting
them into method calls. Here are two cases I have been
trying to figure out for a current project.
The first is passing methods to dispatcher methods. In
pseudocode, something like this:
def dispatcher(self,methodname):
self.obj1.methodname()
self.obj2.methodname()
and another case is selecting behavior of an object by
setting a type string, with pseudo code like this:
self.IBM029 = re.compile([^acharset]
self.IBM026 = re.compile([^anothercharset]
self.type = "IBM029"
errs = self.(self.type).findall(aCardImage)
I have yet to find any way to do either, although it appears
I could do some of it using a long and roundabout call string
using __dict__.
What is the Python dialect for this sort of runtime OO?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iD8DBQFJ3PFRZHES7UL0zXERAiXAAJ0UZyD3589G9hTL/N9A0ect1steAgCaApWJ
HKVHFl3zCrZgSsJEtLU/VJ4=
=B//P
-----END PGP SIGNATURE-----
to doing in other OO languages which I have not yet
figured out how to do in Python, the most important
of which is passing method names as args and inserting
them into method calls. Here are two cases I have been
trying to figure out for a current project.
The first is passing methods to dispatcher methods. In
pseudocode, something like this:
def dispatcher(self,methodname):
self.obj1.methodname()
self.obj2.methodname()
and another case is selecting behavior of an object by
setting a type string, with pseudo code like this:
self.IBM029 = re.compile([^acharset]
self.IBM026 = re.compile([^anothercharset]
self.type = "IBM029"
errs = self.(self.type).findall(aCardImage)
I have yet to find any way to do either, although it appears
I could do some of it using a long and roundabout call string
using __dict__.
What is the Python dialect for this sort of runtime OO?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iD8DBQFJ3PFRZHES7UL0zXERAiXAAJ0UZyD3589G9hTL/N9A0ect1steAgCaApWJ
HKVHFl3zCrZgSsJEtLU/VJ4=
=B//P
-----END PGP SIGNATURE-----