该文档令人困惑。他们的意思是:
import ConfigParser, osdef get_config(): config = ConfigParser.ConfigParser() config.optionxform=str try: config.read(os.path.expanduser('~/.myrc')) return config except Exception, e: log.error(e)c = get_config() print c.options('rules')即覆盖optionxform,而不是调用它;重写可以在子类或实例中完成。覆盖时,将其设置为函数(而不是调用函数的结果)。
我现在将其报告为Bug,此问题已得到修复。



