allow selectors to be a single element instead of tuples (this is the first step towards removing the metaclass) tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Tue, 17 Feb 2009 20:32:01 +0100
branchtls-sprint
changeset 686 6a1f4210ee4c
parent 685 2538262ffc29
child 687 c23315c11185
allow selectors to be a single element instead of tuples (this is the first step towards removing the metaclass)
vregistry.py
--- a/vregistry.py	Tue Feb 17 18:17:51 2009 +0100
+++ b/vregistry.py	Tue Feb 17 20:32:01 2009 +0100
@@ -105,6 +105,8 @@
                             "can't be used together")
         if '__select__' not in classdict and '__selectors__' in classdict:
             selectors = classdict['__selectors__']
+            if not isinstance(selectors, (tuple, list)):
+                selectors = (selectors,)
             if len(selectors) > 1:
                 classdict['__select__'] = classmethod(chainall(*selectors))
             else: