[Mailman-Users] getting count of users

Mark Sapiro mark at msapiro.net
Mon May 25 17:03:07 CEST 2015


mat houser wrote:

> len(mlist.members) should work.


This is wrong for two reasons.

1) mlist.members is not defined in the MemberAdaptor API, it is an
artifact of OldStyleMemberships.py which is the default MemberAdaptor,
but not necessarily the one in use for a particular list, and more
importantly,

2) even with OldStyleMemberships.py, the mlist.members dictionary only
includes regular members, not digest members.

The proper public methods which return lists of all members, regular
members and digest members are respectively getMembers,
getRegularMemberKeys and getDigestMemberKeys.

Thus, as I posted previously, the way to get the total number of members is

    len(mlist.getMembers())

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


More information about the Mailman-Users mailing list