[Mailman-Users] Looking for config info
Leonardo Rochael Almeida
lra at insite.com.br
Wed Jun 21 01:07:51 CEST 2000
On Tue, 20 Jun 2000, Dan Mick wrote:
> > Just a tip. if <attrname> is an attribute full of values (such as long
> > lists or dictionaries), or with long values (such as e-mails held for
> > approval 'cause they were too big), you won't be able to do much with the
> > values. One suggestion is to type:
> > >>> type(m.<attribute>)
> > to discover what type of attribute it is.
> Sure. But knowing the type doesn't tell you much about what it contains.
Yes, but you can, if it is a list or tuple, get m.<attribute> or
m.<attribute>[0:5] to get just a few elements. Or if it is a dictionary
(for the perl folks in the audience, dictionary is the python idiom for
associative arrays or hashes), you can get m.<attribute>.keys() to get the
(tada!!) keys or m.<attribute>['<one of the keys>'].
You can also call type() on elements of lists and dictionaries in case
they are big too.
> > > Note: when you do this, you're writing Python code. Don't assign
> > > things to m or m.<attribute> unless you know what you're doing...but
> > > the above (dir(m) and m.<attr>) are completely safe.
> > Well, unless I'm mistaken (which I usually am :-), you can do pretty much
> > anything, as long as you don't call "m.Save()".
> True; I was erring on the side of caution (as "assigning to an
> attribute" doesn't stay permanent without the Save, and there's no
> point in it for "exploring".)
More information about the Mailman-Users