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

Remove old-deprecated plistlib features #73382

Closed
serhiy-storchaka opened this issue Jan 7, 2017 · 9 comments
Closed

Remove old-deprecated plistlib features #73382

serhiy-storchaka opened this issue Jan 7, 2017 · 9 comments
Assignees
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 29196
Nosy @rhettinger, @ronaldoussoren, @serhiy-storchaka
PRs
  • bpo-29196: Removed old-deprecated classes Plist, Dict and _InternalDict #488
  • Files
  • plistlib_remove_deprecated_classes.patch
  • 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 = 'https://github.com/ronaldoussoren'
    closed_at = <Date 2017-05-15.10:39:33.562>
    created_at = <Date 2017-01-07.16:52:20.485>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Remove old-deprecated plistlib features'
    updated_at = <Date 2017-05-15.10:39:33.560>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-05-15.10:39:33.560>
    actor = 'serhiy.storchaka'
    assignee = 'ronaldoussoren'
    closed = True
    closed_date = <Date 2017-05-15.10:39:33.562>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2017-01-07.16:52:20.485>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['46196']
    hgrepos = []
    issue_num = 29196
    keywords = ['patch']
    message_count = 9.0
    messages = ['284925', '289666', '293603', '293617', '293622', '293625', '293682', '293702', '293705']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'ronaldoussoren', 'serhiy.storchaka']
    pr_nums = ['488']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue29196'
    versions = ['Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    Seems many features of plistlib was deprecated from the start. The plistlib module was added in 2.6 and its code already contained deprecated features:

    • The _InternalDict class is a dict subclass with implemented __getattr__/setattr/delattr methods, but all these methods have been deprecated. Since deprecated methods shouldn't be used and they are not implemented in builting dict, _InternalDict can be replaced by builting dict.

    • The Dict class has been deprecated. It doesn't used in the module. A user should use builting dict instead.

    • The Plist class has been deprecated. It doesn't used in the module. A user should use module level functions instead of Plist methods.

    It seems to me that all these classes can be removed. This doesn't break compatibility, since they were deprecated in 2.6. They are even not documented in 2.7.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jan 7, 2017
    @serhiy-storchaka
    Copy link
    Member Author

    These classes was deprecated in 2.4. In 2.6 the plistlib module was moved from plat-mac to the general stdlib library.

    @serhiy-storchaka
    Copy link
    Member Author

    What are your thoughts about this Ronald?

    @rhettinger
    Copy link
    Contributor

    Ronald, I'm curious about why was the attribute access capability was ever deprecated. That capability seemed nice to have.

    @serhiy-storchaka
    Copy link
    Member Author

    The deprecation was added in 368c0b2. The comment added in 4c3d054 said that Dict was kept for compatibility with Python 2.2.

    @rhettinger
    Copy link
    Contributor

    Too bad the checkin message didn't say why the feature was deprecated.

    That said, if anyone cared, they would have spoken-up by now.

    @ronaldoussoren
    Copy link
    Contributor

    I don't know why the feature was deprecated, is was deprecated a long time ago by Just.

    I agree that the feature is convenient at times, but it is also different from how dicts are generally used.

    BTW. I'm in favour of removing the feature, not having this deprecated feature makes the library easier to understand and maintain.

    P.S. plistlib was not introduced in 2.6, but in 2.3. In 2.3 it was part of the MacOS library (Lib/plat-mac) and in 2.6 it was migrated to the regular stdlib.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset edef358 by Serhiy Storchaka in branch 'master':
    bpo-29196: Removed old-deprecated classes Plist, Dict and _InternalDict (#488)
    edef358

    @serhiy-storchaka
    Copy link
    Member Author

    If the capability of the former plistlib.Dict class is useful, it would be better to provide it for general use in modules collections or types.

    @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
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants