Title: ConfigParsers are classic classes
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, hauva
Priority: normal Keywords: patch

Created on 2008-06-23 16:48 by hauva, last changed 2008-07-20 11:16 by georg.brandl. This issue is now closed.

File name Uploaded Description Edit
configparser.diff hauva, 2008-06-23 16:48 hauva, 2008-06-23 16:51
Messages (4)
msg68639 - (view) Author: Ari Makela (hauva) Date: 2008-06-23 16:48
The base class, ConfigParser.RawConfigParser does not inherit object and
therefore it is a classic class.

Test script run with my normal python installation:

$ /usr/bin/python -V
Python 2.5.2

$ /usr/bin/python arska/

And run with uptodate svn checkout with modified

$ LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/python -V
Python 2.6b1+

$ LD_LIBRARY_PATH=/usr/local/lib arska/
Setting value=bar
Getting value=bar

Platform: Kubuntu 8.04.
$ uname -a
Linux laphroaig 2.6.24-19-generic #1 SMP Wed Jun 4 15:10:52 UTC 2008
x86_64 GNU/Linux

The test script and diff -u as attachments.
msg68640 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-06-23 17:07
Why do you think ConfigParser should be a new-style class?
msg68673 - (view) Author: Ari Makela (hauva) Date: 2008-06-24 09:48
New-style classes make object orientated programming considerably more
convenient. For example one can use property() instead of __setitem__ et
al. There's super(). This is, of course, not a serious problem and one
can always implement a composite class which inherits from object and
has a configparser as an attribute.

This would be a nice improvement and as far as I know completely safe.
msg70072 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-20 11:16
When creating your own subclass, you can always inherit from object too
to create a new-style class.
Date User Action Args
2008-07-20 11:16:13georg.brandlsetstatus: pending -> closed
messages: + msg70072
2008-06-24 09:48:18hauvasetmessages: + msg68673
2008-06-23 17:07:36georg.brandlsetstatus: open -> pending
resolution: not a bug
messages: + msg68640
nosy: + georg.brandl
2008-06-23 16:51:21hauvasetfiles: +
2008-06-23 16:50:16hauvasetfiles: - configparser.diff
2008-06-23 16:50:07hauvasetfiles: + configparser.diff
2008-06-23 16:48:08hauvacreate