Returns a generator which yields a ``(property name, property value)`` tuple with each iteration. Note: This will not yield vars that are attached during parse, such as ``__input_schemalocations__`` and ``__input_namespaces__``.
(obj)
| 242 | |
| 243 | |
| 244 | def iter_vars(obj): |
| 245 | """Returns a generator which yields a ``(property name, property value)`` |
| 246 | tuple with each iteration. |
| 247 | |
| 248 | Note: |
| 249 | This will not yield vars that are attached during parse, such as |
| 250 | ``__input_schemalocations__`` and ``__input_namespaces__``. |
| 251 | |
| 252 | """ |
| 253 | def check(name): |
| 254 | return name not in ('__input_namespaces__', '__input_schemalocations__') |
| 255 | |
| 256 | instance_vars = iteritems(vars(obj)) |
| 257 | return ((attr_name(name), val) for name, val in instance_vars if check(name)) |
| 258 | |
| 259 | |
| 260 | def is_dictable(obj): |