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

[threading] Add daemon argument to Timer #74704

Closed
awolokita mannequin opened this issue May 31, 2017 · 2 comments
Closed

[threading] Add daemon argument to Timer #74704

awolokita mannequin opened this issue May 31, 2017 · 2 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@awolokita
Copy link
Mannequin

awolokita mannequin commented May 31, 2017

BPO 30519
Nosy @pitrou, @vstinner, @Mariatta, @awolokita
PRs
  • bpo-30519: Add daemon keyword to Timer class constructor #1878
  • 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 2020-03-09.11:14:13.469>
    created_at = <Date 2017-05-31.02:54:13.332>
    labels = ['3.8', 'type-feature', 'library']
    title = '[threading] Add daemon argument to Timer'
    updated_at = <Date 2020-03-09.11:14:13.468>
    user = 'https://github.com/awolokita'

    bugs.python.org fields:

    activity = <Date 2020-03-09.11:14:13.468>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-03-09.11:14:13.469>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2017-05-31.02:54:13.332>
    creator = 'awolokita'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30519
    keywords = []
    message_count = 2.0
    messages = ['294808', '363715']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'vstinner', 'Mariatta', 'awolokita']
    pr_nums = ['1878']
    priority = 'normal'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30519'
    versions = ['Python 3.8']

    @awolokita
    Copy link
    Mannequin Author

    awolokita mannequin commented May 31, 2017

    Currently in order to have daemonic Timer objects one must instantiate the class, set daemonic status through the property (Timer.daemon=True), and then start the Timer. It would be nice to have the ability to set the daemonic status of the Timer class during instantiation, similar to what is possible with the Thread superclass.

    This is a trivial enhancement to implement: simply add the daemon keyword argument to the Timer constructor, defaulted to None, and pass it on to the Thread constructor in the call to super().__init__.

    @awolokita awolokita mannequin added 3.7 (EOL) end of life type-feature A feature request or enhancement labels May 31, 2017
    @Mariatta Mariatta added the stdlib Python modules in the Lib dir label May 31, 2017
    @csabella csabella added 3.8 only security fixes and removed 3.7 (EOL) end of life labels Apr 13, 2019
    @csabella csabella changed the title Add daemon argument to Timer [threading] Add daemon argument to Timer Apr 13, 2019
    @vstinner
    Copy link
    Member

    vstinner commented Mar 9, 2020

    Daemon threads are very fragile by design. I would prefer to not promote their usage. See for example bpo-39877 for a recent example. I would prefer to remove support for daemon threads, rather than adding more daemon threads!

    I reject the issue.

    Moreover, PR 1878 has been closed.

    @vstinner vstinner closed this as completed Mar 9, 2020
    @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.8 only security fixes 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