#15956: WeakValueDictionary does not handle unhashable keys correctly
-------------------------------------+-------------------------------------
       Reporter:  saraedum           |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  minor              |    Milestone:  sage-6.2
      Component:  misc               |   Resolution:
       Keywords:  hash               |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/nbruin/ticket/15956              |  c60d3c6caefd6626ce5881252e66f71524461651
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by nbruin):

 * commit:  3a05a1aec6459e59f0b7069af4bc1100a71a9502 =>
     c60d3c6caefd6626ce5881252e66f71524461651


Comment:

 Turns out backporting `PyDict_GetItemWithError` isn't nearly as bad as it
 seems in cython. We are relying on details about the `PyDict`
 implementation that are not officially part of the CAPI, but they do occur
 in `Python.h`. We're already doing worse here by digging up the non-
 exported `Dummy` value for dict tables.

 The current implementation is actually a little faster than
 `PyDict_GetItem` (because we don't need to clear errors, probably). We
 could unwrap the use of these even further into the various places where
 `PyDict_GetItemWithError` is used, but for now this should be good enough.
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=c60d3c6caefd6626ce5881252e66f71524461651
 c60d3c6]||{{{trac #15956: Provide PyDict_GetItemWithError and use it to
 obtain appropriate errors when looking up weakdict entries}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/15956#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to