Subclassing ConfigParser question

Roy H. Berger roybrew at att.net
Tue Nov 25 11:36:27 EST 2003


If I want to subclass ConfigParser and changed the optionxform method
to not return things in lower case wouldn't I just need the following
code in my subclasss module?

from ConfigParser import *

class MyConfigParser(ConfigParser):
	def __init__(self, defaults=None):
		ConfigParser.__init__(self, defaults)

	def optionxform (self, optionstr):
		return optionstr

Or do I need to re-implement all of the methods of ConfigParser? 
Sorry -- haven't done much subclassing with python.

Thanks in advance.

Roy
roybrew at att.net




More information about the Python-list mailing list