zopefoundation/zope.schema — pull request #2 by eleddy (2013-06-17 23:25:25+00:00)
Title: Add option to swallow duplicates in SimpleVocabulary

I'm not 100% proud of this pull but I have seen this error so much its painful. It's often the case that vocabularies are generated from databases or even worse, user input (dexterity). When these duplicates infiltrate the system, the rendering of a form causes what users like to call "KABOOM". This would just allow duplicates to be in the system and not raise an error. The logic may be fuzzy, but its especially important for fields that aren't required to submit a form. This just says that the last value that was passed in wins. I know its not pretty, but I see this as a win for end users in apps built on top of this, especially in plone/z3c.form. It's hard to rely on developers to always catch the edge cases here. This is unobtrusive and low risk.