Why is there {Raw,Safe}ConfigParser in Python 3?

前端 未结 1 1736
我在风中等你
我在风中等你 2021-02-18 23:48

Am surprised there\'s 3 different forms: RawConfigParser, SafeConfigParser and ConfigParser (docs). I read the differences but why isn\'t

相关标签:
1条回答
  • 2021-02-19 00:34

    In short, use configparser.SafeConfigParser.

    To quote the docs, SafeConfigParser "implements a more-sane variant of the magical interpolation feature. This implementation is more predictable as well. New applications should prefer this version if they don’t need to be compatible with older versions of Python."

    It seems that the old ConfigParser still exists in Python 3 for backwards compatibility: not everything was made backward-incompatible!

    0 讨论(0)
提交回复
热议问题