Is WeakValueDictionary thread-safe?

Discussion in 'Python' started by Luke, May 19, 2004.

  1. Luke

    Luke Guest

    Hi,

    Is weakref.WeakValueDictionary supposed to be thread-safe?

    This small example script (attached) uses two threads to add and remove
    items from a WeakValueDictionary. It is giving me a number of error
    messages on stderr (with 2.3.3 & 2.3.4rc1) which look like this:

    Exception exceptions.KeyError: 'bar' in <function remove at
    0x4017372c> ignored

    Should this work without printing these errors, or have I misunderstood?
    I just wanted to check with this newsgroup before filing a bug...

    Thanks,
    Luke.
     
    Luke, May 19, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bryan

    WeakValueDictionary

    Bryan, Oct 3, 2004, in forum: Python
    Replies:
    3
    Views:
    965
    Andrew Dalke
    Oct 3, 2004
  2. Gabriel Rossetti
    Replies:
    0
    Views:
    1,361
    Gabriel Rossetti
    Aug 29, 2008
  3. Paul McGuire

    Memoizing and WeakValueDictionary

    Paul McGuire, Jan 4, 2009, in forum: Python
    Replies:
    1
    Views:
    325
  4. Replies:
    1
    Views:
    354
    Brian Candler
    Aug 12, 2003
  5. John Nagle
    Replies:
    5
    Views:
    485
    John Nagle
    Mar 12, 2012
Loading...

Share This Page