Show More
@@ -278,11 +278,16 b' def xiter(item, mode):' | |||||
278 | func = item.__xiter__ |
|
278 | func = item.__xiter__ | |
279 | except AttributeError: |
|
279 | except AttributeError: | |
280 | if isinstance(item, dict): |
|
280 | if isinstance(item, dict): | |
281 |
|
|
281 | def items(item): | |
|
282 | fields = ("key", "value") | |||
|
283 | for (key, value) in item.iteritems(): | |||
|
284 | yield Fields(fields, key=key, value=value) | |||
|
285 | return items(item) | |||
282 | elif isinstance(item, new.module): |
|
286 | elif isinstance(item, new.module): | |
283 | def items(item): |
|
287 | def items(item): | |
|
288 | fields = ("key", "value") | |||
284 | for key in sorted(item.__dict__): |
|
289 | for key in sorted(item.__dict__): | |
285 |
yield |
|
290 | yield Fields(fields, key, getattr(item, key)) | |
286 | return items(item) |
|
291 | return items(item) | |
287 | elif isinstance(item, basestring): |
|
292 | elif isinstance(item, basestring): | |
288 | if not len(item): |
|
293 | if not len(item): |
General Comments 0
You need to be logged in to leave comments.
Login now