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

Deprecate threading.Thread.isDaemon etc #68391

Closed
anon mannequin opened this issue May 15, 2015 · 6 comments
Closed

Deprecate threading.Thread.isDaemon etc #68391

anon mannequin opened this issue May 15, 2015 · 6 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@anon
Copy link
Mannequin

anon mannequin commented May 15, 2015

BPO 24203
Nosy @rhettinger, @bitdancer, @berkerpeksag
Superseder
  • bpo-43723: Deprecate camelCase aliases from threading.py
  • Files
  • issue24203.diff
  • 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 2021-06-24.13:59:45.978>
    created_at = <Date 2015-05-15.16:38:54.109>
    labels = ['type-feature', 'library']
    title = 'Deprecate threading.Thread.isDaemon etc'
    updated_at = <Date 2021-06-24.13:59:45.978>
    user = 'https://bugs.python.org/anon'

    bugs.python.org fields:

    activity = <Date 2021-06-24.13:59:45.978>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-06-24.13:59:45.978>
    closer = 'iritkatriel'
    components = ['Library (Lib)']
    creation = <Date 2015-05-15.16:38:54.109>
    creator = 'anon'
    dependencies = []
    files = ['41292']
    hgrepos = []
    issue_num = 24203
    keywords = ['patch']
    message_count = 6.0
    messages = ['243277', '254345', '256304', '256310', '256328', '258170']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'r.david.murray', 'berker.peksag', 'anon']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '43723'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue24203'
    versions = ['Python 3.6']

    @anon
    Copy link
    Mannequin Author

    anon mannequin commented May 15, 2015

    In threading.Thread isDaemon, setDaemon, getName, setName are not needed since 2.6 (preferring directly changing daemon or name instead). They should probably be depreciated in 3.5 and removed later. isAlive has already been removed.

    @anon
    Copy link
    Mannequin Author

    anon mannequin commented Nov 8, 2015

    Any consensus?

    @berkerpeksag
    Copy link
    Member

    +1 for deprecating them. Removing them would make porting code from Python 2 harder so I think it's better to keep them for a while.

    @berkerpeksag berkerpeksag added the stdlib Python modules in the Lib dir label Dec 13, 2015
    @berkerpeksag berkerpeksag changed the title Depreciate threading.Thread.isDaemon etc Deprecate threading.Thread.isDaemon etc Dec 13, 2015
    @berkerpeksag berkerpeksag added the type-feature A feature request or enhancement label Dec 13, 2015
    @rhettinger
    Copy link
    Contributor

    Removing them would make porting code from Python 2 harder
    so I think it's better to keep them for a while.

    So, no deprecations. The API is now a bit redundant but it isn't broken or problematic in any way. We don't have to deprecate this for any reason other than to satisfy a personal sense of neatness and compactness.

    This API has long history. See https://docs.python.org/release/1.5.2/lib/thread-objects.html. The older the API, the more likely that there is a lot of existing code that relies on the API (including public and private projects that no longer have an active maintainer or adequate tests).

    For the sake of developers who rely on the standard library being "standard" and for the mountains of existing code on PyPI, we need to have a strong aversion to unnecessary deprecations. The deprecations cause headaches for users, they present obstacles to upgrading Python, and they increase the likelihood that package distributors will monkey-patch or duplicate the code to restore prior behavior (for example, the Hypothesis project will likely have to duplicate the code that was recently taken out of the inspect module in favor of signature objects).

    Put me down for a -1 on a unnecessary deprecation. We should put more focus on proposed new APIs and making sure that they are something we want to live with for a very long time. The saying is that the standard library is where code goes to die and it should preferably be dead-on-arrival (one reason that Requests is not be added to the standard library is that the code is still living and evolving).

    @bitdancer
    Copy link
    Member

    Well, the idea would be to do a documentation-only deprecation; as in, effectively: this is the older API, you probably really want to use this newer API that is more convenient. I don't have a strong opinion either way in this case.

    @berkerpeksag
    Copy link
    Member

    The docs for old API already say:

    Old getter/setter API for name; use it directly as a property instead.
    

    https://docs.python.org/3.5/library/threading.html#threading.Thread.getName

    Users don't read the documentation every six or fifteen months so it would be nice to document old APIs properly as deprecated. And I don't think documentation-only deprecation would work. See bpo-25964 for a real world example. Users still don't know that optparse is deprecated.

    We don't have to deprecate this for any reason other than to satisfy a personal sense of neatness and compactness.

    The original request came from a Python user, not from a new generation perfectionist core developer.

    For the sake of developers who rely on the standard library being "standard" and for the mountains of existing code on PyPI, we need to have a strong aversion to unnecessary deprecations.

    That doesn't mean we shouldn't tell users "Hey, there is a new API which was added back in 2008. Use it if you want to."

    [...] and they increase the likelihood that package distributors will monkey-patch or duplicate the code to restore prior behavior (for example, the Hypothesis project will likely have to duplicate the code that was recently taken out of the inspect module in favor of signature objects).

    I'm not sure we are on the same page here. I already said that I don't want to remove the old API, but document it properly as deprecated. The inspect case you've mentioned has already been solved in bpo-25486. See bpo-26069 (old trace API) and bpo-26041 (platform.dist() and platform.linux_distribution() deprecation) for my views on deprecation policy.

    We should put more focus on proposed new APIs and making sure that they are something we want to live with for a very long time.

    Agreed, but we need to advertise new APIs better. Otherwise no one is going to notice and use them. I think deprecating old APIs (with a clear upgrade path) would be a good way to promote new ones.

    @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-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants