views:

66

answers:

1

Am surprised there's 3 different forms: RawConfigParser, SafeConfigParser and ConfigParser. I read the differences but why isn't everyone using SafeConfigParser, since it seems, well, safe? I can understand that in the case for Python 2 that the other two were kept for backward compatibility.

+1  A: 

In short, use configparser.SafeConfigParser.

To quote the docs, SafeConigParser "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!

blokeley