Home | Trees | Indices | Help |
|
---|
|
object --+ | _abcoll.Sized --+ | object --+ | | | _abcoll.Iterable --+ | object --+ | | | _abcoll.Container --+ | _abcoll.Set --+ | _abcoll.MutableSet --+ | Classes
Provides access to an element's class attribute as a set-like collection. Usage:
>>> el = fromstring('<p class="hidden large">Text</p>') >>> classes = el.classes # or: classes = Classes(el.attrib) >>> classes |= ['block', 'paragraph'] >>> el.get('class') 'hidden large block paragraph' >>> classes.toggle('hidden') False >>> el.get('class') 'large block paragraph' >>> classes -= ('some', 'classes', 'block') >>> el.get('class') 'large paragraph'
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from |
|
|||
__abstractmethods__ =
|
|||
_abc_negative_cache = <_weakrefset.WeakSet object at 0x2b96b71
|
|||
_abc_negative_cache_version = 22
|
|||
_abc_registry = <_weakrefset.WeakSet object at 0x2b96b719e650>
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
|
|
|
|
Add a class. This has no effect if the class is already present.
|
Remove a class if it is currently present. If the class is not present, do nothing.
|
Remove a class; it must currently be present. If the class is not present, raise a KeyError.
|
Add a class name if it isn't there yet, or remove it if it exists. Returns true if the class was added (and is now enabled) and false if it was removed (and is now disabled). |
|
_abc_negative_cache
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Nov 13 08:53:00 2015 | http://epydoc.sourceforge.net |