BUG: Rule
s with the same name result in KeyError
when both are added to a Rule_Collection
#30
Labels
Bug
Something isn't working
Describe the issue:
Use the
id()
function to define the key values of aRule
object in aRule_Collection
rather than aRule
's name.id(Rule)
returns a unique value (integer) for each object, so no two uniqueRule
s will have the sameid()
value.However, two rules may have the same name, so even if the rules are different (have different attributes and serve different purposes), if they have the same name (which is also possible because they may both be unnamed and just use the default name), then there will be an error in the
Rule_Collection
.Reproduce the code example:
Error message:
KeyError: 'Mango is already in the collection of rules. Use update_rule() to change the value of this rule'
Screenshots
No response
OS
Mac
The text was updated successfully, but these errors were encountered: