Issue 3181: ConfigParsers are classic classes (original) (raw)

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:35 admin set github: 47431
2008-07-20 11:16:13 georg.brandl set status: pending -> closedmessages: +
2008-06-24 09:48:18 hauva set messages: +
2008-06-23 17:07:36 georg.brandl set status: open -> pendingresolution: not a bugmessages: + nosy: + georg.brandl
2008-06-23 16:51:21 hauva set files: + configparser.py
2008-06-23 16:50:16 hauva set files: - configparser.diff
2008-06-23 16:50:07 hauva set files: + configparser.diff
2008-06-23 16:48:08 hauva create