I ran my program in Python 3.4, and it crashed. Stack trace:
Traceback (most recent call last):
[...]
File [...], line 176, in manual_setup
gammas.add((name, group_oid))
KeyError: '5733455d-ba37-48c6-b550-8f53b719310c'
Here's the code at that line. Never mind what the variables are, just that gammas is a set, as you can see:
gammas = set()
for group_oid, name, _ in self.tags:
gammas.add((name, group_oid))
By the way, name and group_oid are both str, but even if they were something unhashable, I'd get a different error.
I'm not excluding the possibility that I have something totally different going on, but before I look into weird causes I haven't even thought of yet, I'd like to know if set.add could possibly be throwing KeyError. The documentation suggests no. My knowledge of how sets work says it shouldn't. Has anyone out there seen this happen?
I checked to see if set was somehow overridden. PyCharm says it's the built-in Python set.
set.additself should not raise aKeyError. What kind of object isself.tags? Any chance it does anything clever like lazy loading entries on iteration?self.tagsis a list. To be sure, I'll print out the type just in case, along withgroup_oidandname, when I debug.