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

sched modules queue property should return a list, not an iterator #62632

Closed
rhettinger opened this issue Jul 12, 2013 · 5 comments
Closed

sched modules queue property should return a list, not an iterator #62632

rhettinger opened this issue Jul 12, 2013 · 5 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@rhettinger
Copy link
Contributor

BPO 18432
Nosy @rhettinger, @giampaolo, @serhiy-storchaka
Files
  • sched.diff: Fix sched.queue
  • 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 2013-07-14.05:49:59.578>
    created_at = <Date 2013-07-12.07:31:21.483>
    labels = ['type-bug', 'library']
    title = 'sched modules queue property should return a list, not an iterator'
    updated_at = <Date 2013-07-14.08:42:40.357>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2013-07-14.08:42:40.357>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-07-14.05:49:59.578>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2013-07-12.07:31:21.483>
    creator = 'rhettinger'
    dependencies = []
    files = ['30900']
    hgrepos = []
    issue_num = 18432
    keywords = ['patch']
    message_count = 5.0
    messages = ['192927', '192932', '192986', '193027', '193040']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'giampaolo.rodola', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue18432'
    versions = ['Python 3.3', 'Python 3.4']

    @rhettinger
    Copy link
    Contributor Author

    In Python 2, the queue attribute was a list and it is still documented that way in Python 3: http://docs.python.org/3/library/sched.html#sched.scheduler.queue

    This appears to be a mistake made during the 2-to-3 conversion.

    @rhettinger rhettinger added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 12, 2013
    @serhiy-storchaka
    Copy link
    Member

    Perhaps it will be better document it as an iterator? In any case we can call list() to get a list.

    @rhettinger
    Copy link
    Contributor Author

    It's pretty weird to use a property for an iterator. It we really wanted iteration, the appropriate method would be __iter__.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 14, 2013

    New changeset 359002d4370d by Raymond Hettinger in branch '3.3':
    Issue bpo-18432: Fix unintended API change in the sched module
    http://hg.python.org/cpython/rev/359002d4370d

    @serhiy-storchaka
    Copy link
    Member

    Thank you for explanation.

    @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

    2 participants