Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigParsers are classic classes #47431

Closed
hauva mannequin opened this issue Jun 23, 2008 · 4 comments
Closed

ConfigParsers are classic classes #47431

hauva mannequin opened this issue Jun 23, 2008 · 4 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@hauva
Copy link
Mannequin

hauva mannequin commented Jun 23, 2008

BPO 3181
Nosy @birkenfeld
Files
  • configparser.diff
  • configparser.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2008-07-20.11:16:13.917>
    created_at = <Date 2008-06-23.16:48:08.877>
    labels = ['invalid', 'type-bug', 'library']
    title = 'ConfigParsers are classic classes'
    updated_at = <Date 2008-07-20.11:16:13.916>
    user = 'https://bugs.python.org/hauva'

    bugs.python.org fields:

    activity = <Date 2008-07-20.11:16:13.916>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-07-20.11:16:13.917>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2008-06-23.16:48:08.877>
    creator = 'hauva'
    dependencies = []
    files = ['10710', '10712']
    hgrepos = []
    issue_num = 3181
    keywords = ['patch']
    message_count = 4.0
    messages = ['68639', '68640', '68673', '70072']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'hauva']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3181'
    versions = ['Python 2.6']

    @hauva
    Copy link
    Mannequin Author

    hauva mannequin commented Jun 23, 2008

    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.

    @hauva hauva mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jun 23, 2008
    @birkenfeld
    Copy link
    Member

    Why do you think ConfigParser should be a new-style class?

    @hauva
    Copy link
    Mannequin Author

    hauva mannequin commented Jun 24, 2008

    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.

    @birkenfeld
    Copy link
    Member

    When creating your own subclass, you can always inherit from object too
    to create a new-style class.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant