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

Missing parameter "n" on multiprocessing.Condition.notify() #73479

Closed
VictordelaFuente mannequin opened this issue Jan 17, 2017 · 5 comments
Closed

Missing parameter "n" on multiprocessing.Condition.notify() #73479

VictordelaFuente mannequin opened this issue Jan 17, 2017 · 5 comments
Assignees
Labels
3.7 (EOL) end of life build The build process and cross-build stdlib Python modules in the Lib dir

Comments

@VictordelaFuente
Copy link
Mannequin

VictordelaFuente mannequin commented Jan 17, 2017

BPO 29293
Nosy @pitrou, @vstinner, @MojoVampire, @applio
PRs
  • bpo-29293: multiprocessing.Condition.notify() lacks parameter n #2480
  • 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/applio'
    closed_at = <Date 2017-07-04.06:59:42.107>
    created_at = <Date 2017-01-17.08:43:56.954>
    labels = ['3.7', 'build', 'library']
    title = 'Missing parameter "n" on multiprocessing.Condition.notify()'
    updated_at = <Date 2017-07-05.13:44:56.687>
    user = 'https://bugs.python.org/VictordelaFuente'

    bugs.python.org fields:

    activity = <Date 2017-07-05.13:44:56.687>
    actor = 'vstinner'
    assignee = 'davin'
    closed = True
    closed_date = <Date 2017-07-04.06:59:42.107>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2017-01-17.08:43:56.954>
    creator = 'Victor de la Fuente'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 29293
    keywords = []
    message_count = 5.0
    messages = ['285623', '285625', '285767', '297628', '297750']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'vstinner', 'josh.r', 'davin', 'Victor de la Fuente']
    pr_nums = ['2480']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue29293'
    versions = ['Python 3.7']

    @VictordelaFuente
    Copy link
    Mannequin Author

    VictordelaFuente mannequin commented Jan 17, 2017

    Versions:
    Darwin MacBook-Pro-de-Victor.local 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64
    Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

    import multiprocessing as mp
    
    condition = mp.Condition()
    
    with condition:
        condition.notify(2) #Docs show notify(n=1)
    #TypeError: notify() takes 1 positional argument but 2 were given

    #Replacing the call with condition.notify(2):
    #TypeError: notify() got an unexpected keyword argument 'n'

    # Docs show signature: def notify(self, n=1)
    # But found this debugging:

    # multiprocessing/synchronize.py
    # line 211: class Condition(object):
    # .....
    # line 271: def notify(self): #<-- ¿There is no n paramater?
    # .....

    @VictordelaFuente VictordelaFuente mannequin added stdlib Python modules in the Lib dir build The build process and cross-build labels Jan 17, 2017
    @VictordelaFuente
    Copy link
    Mannequin Author

    VictordelaFuente mannequin commented Jan 17, 2017

    Sorry for the typo, I meant:

    #Replacing the call with condition.notify(n=2):
    #TypeError: notify() got an unexpected keyword argument 'n'

    @MojoVampire
    Copy link
    Mannequin

    MojoVampire mannequin commented Jan 19, 2017

    Looks like, despite what the multiprocessing.Condition docs say (claiming it's an alias for threading.Condition), at least in Python 3.5, it's a completely separate animal from multiprocessing.synchronize, and the notify method on it doesn't take any parameters.

    Seems like an obvious thing to fix; the parameter is defaulted anyway, so existing code should continue to work, and it makes multiprocessing swap in for threading more seamlessly.

    @pitrou pitrou added the 3.7 (EOL) end of life label Jun 28, 2017
    @pitrou
    Copy link
    Member

    pitrou commented Jul 4, 2017

    New changeset 4835041 by Antoine Pitrou in branch 'master':
    bpo-29293: multiprocessing.Condition.notify() lacks parameter n (bpo-2480)
    4835041

    @pitrou pitrou closed this as completed Jul 4, 2017
    @vstinner
    Copy link
    Member

    vstinner commented Jul 5, 2017

    New changeset 8207c17 by Victor Stinner in branch 'master':
    Revert "bpo-30822: Fix testing of datetime module." (bpo-2588)
    8207c17

    @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 build The build process and cross-build stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants