GNOME Bugzilla – Bug 677249
gi: Fix boxed type equality
Last modified: 2012-06-01 13:49:29 UTC
Any two boxed wrappers with the same pointer (ref'd boxed types are quite common) won't equal each other, because we don't test for the boxed type correctly. If the two boxed wrappers are the same, it evaluates to True, but will still test to False in this path, leading Python to fall back to the default "a is b" test.
Created attachment 215391 [details] [review] gi: Fix boxed type equality Each boxed type has its own Python type, not PyGBoxed_Type. Use PyObject_IsInstance instead of comparing against PyGBoxed_Type directly.
Created attachment 215392 [details] [review] tests: Add a refcounting boxed The gobject-introspection tests side of the patch. I'm surprised that we haven't yet had a refcounting struct in libregress.
Thanks a lot for this! Both pushed.