This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ConfigParsers are classic classes
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
process
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 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
configparser.diff hauva, 2008-06-23 16:48
configparser.py 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/configparser.py
bar

And run with uptodate svn checkout with modified ConfigParser.py

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

$ LD_LIBRARY_PATH=/usr/local/lib arska/configparser.py
Setting value=bar
Getting value=bar
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.
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47431
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: + configparser.py
2008-06-23 16:50:16hauvasetfiles: - configparser.diff
2008-06-23 16:50:07hauvasetfiles: + configparser.diff
2008-06-23 16:48:08hauvacreate