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

Typo in example for async with statement with condition #80007

Closed
mhchia mannequin opened this issue Jan 25, 2019 · 5 comments
Closed

Typo in example for async with statement with condition #80007

mhchia mannequin opened this issue Jan 25, 2019 · 5 comments
Labels
3.8 only security fixes easy topic-asyncio type-feature A feature request or enhancement

Comments

@mhchia
Copy link
Mannequin

mhchia mannequin commented Jan 25, 2019

BPO 35826
Nosy @asvetlov, @1st1, @willingc, @eamanu, @mhchia
PRs
  • bpo-35826: Fix typo in equivalent code of async with cond #11681
  • bpo-35826: Fix typo in equivalent code of async with cond #11681
  • bpo-35826: Fix typo in equivalent code of async with cond #11681
  • bpo-35826: Fix typo in equivalent code of async with cond #11681
  • [3.7] bpo-35826: Fix typo: equivalent code of async with cond (GH-11681) #16720
  • 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 2019-02-22.14:44:26.230>
    created_at = <Date 2019-01-25.10:44:12.895>
    labels = ['easy', 'type-feature', '3.8', 'expert-asyncio']
    title = 'Typo in example for async with statement with condition'
    updated_at = <Date 2019-10-11.17:24:08.075>
    user = 'https://github.com/mhchia'

    bugs.python.org fields:

    activity = <Date 2019-10-11.17:24:08.075>
    actor = 'miss-islington'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-02-22.14:44:26.230>
    closer = 'mhchia'
    components = ['asyncio']
    creation = <Date 2019-01-25.10:44:12.895>
    creator = 'mhchia'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35826
    keywords = ['patch', 'patch', 'patch', 'patch', 'easy']
    message_count = 5.0
    messages = ['334349', '334350', '334376', '336310', '336318']
    nosy_count = 6.0
    nosy_names = ['asvetlov', 'docs@python', 'yselivanov', 'willingc', 'eamanu', 'mhchia']
    pr_nums = ['11681', '11681', '11681', '11681', '16720']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35826'
    versions = ['Python 3.8']

    @mhchia
    Copy link
    Mannequin Author

    mhchia mannequin commented Jan 25, 2019

    In the example of the equivalent code to the async with statement:

    cond = asyncio.Condition()
    
    # ... later
    await lock.acquire()
    try:
        await cond.wait()
    finally:
        lock.release()

    lock.acquire() should be replaced by cond.acquire(), and lock.release() replaced by cond.release(). So the resulting code snippet becomes:

    cond = asyncio.Condition()
    
    # ... later
    await cond.acquire()
    try:
        await cond.wait()
    finally:
        cond.release()

    @mhchia mhchia mannequin added docs Documentation in the Doc dir 3.8 only security fixes labels Jan 25, 2019
    @mhchia mhchia mannequin assigned docspython Jan 25, 2019
    @mhchia mhchia mannequin added the type-feature A feature request or enhancement label Jan 25, 2019
    @mhchia
    Copy link
    Mannequin Author

    mhchia mannequin commented Jan 25, 2019

    In the example of the equivalent code to the async with statement:

    cond = asyncio.Condition()
    
    # ... later
    await lock.acquire()
    try:
        await cond.wait()
    finally:
        lock.release()

    lock.acquire() should be replaced by cond.acquire(), and lock.release() replaced by cond.release(). So the resulting code snippet becomes:

    cond = asyncio.Condition()
    
    # ... later
    await cond.acquire()
    try:
        await cond.wait()
    finally:
        cond.release()

    @1st1
    Copy link
    Member

    1st1 commented Jan 25, 2019

    Please submit a PR!

    @1st1 1st1 added easy topic-asyncio and removed docs Documentation in the Doc dir labels Jan 25, 2019
    @eamanu
    Copy link
    Mannequin

    eamanu mannequin commented Feb 22, 2019

    This issue could be closed, right?

    @mhchia
    Copy link
    Mannequin Author

    mhchia mannequin commented Feb 22, 2019

    Cool! Thanks for the reminder.

    @mhchia mhchia mannequin closed this as completed Feb 22, 2019
    @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 easy topic-asyncio type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant