I merged your patch commit 82f1b229741f9d189c8bb6927ebbba82988fef06 last week:
- return sorted(dd.items(), key=lambda t: t[1], reverse=True)
+ return sorted([(e, c) for e, c in dd.items() if isinstance(e, Entity)],
+ key=lambda t: t[1], reverse=True)
I discovered a small side effect. My Bag class has a contents
property that describes the count and type of the entities inside.
For example, this is what the contents of the pitz project are:
>>> p.contents
'(80 task entities, 4 status entities, 3 milestone entities, 2 comment
entities, 2 component entities, 2 person entities, 1 estimate
entities)'
The contents property uses the the values method on bags to count up
the type of all the entities inside. But now, after your patch, the
type attributes are skipped, so then p.contents looks like this:
>>> p.contents
'()'
I'm going to take your patch out for now and I added in some doctests
on pitz.bag.Bag.contents to verify that Bag.contents works right.
Can I add an optional parameter to Bag.values or can I add a new
method to do what you want? I am guessing that you need this for
something in pitzW.
I want to make this Bag.values method work for you and me.
--
W. Matthew Wilson
ma...@tplus1.com
http://tplus1.com