lxml/lxml — pull request #152 by masklinn (2014-12-16 19:34:57+00:00)
Title: Provide a set interface to HTML classes

PR for https://bugs.launchpad.net/lxml/+bug/1243600

The assertions at the start of add/remove/toggle are to match DOMTokenList's behavior, they seem to make sense.

The set is a simple proxy to the underlying attribute's string (and remove the attribute entirely if the set is emptied to match "unset") which is simple enough for a first version but may not be the most efficient implementation for repeated set operations (should be good for a one-shot though).