On Thu, Dec 13, 2007 at 09:30:44AM +0100, Gael Varoquaux wrote:
> On Wed, Dec 12, 2007 at 06:39:02PM -0700, Fernando Perez wrote:
> > On second thought though: __str__ is the one meant for 'human
> > consumption', while __repr__ is deliberately meant to be much more
> > machine-like. Basically the idea is that, whenever possible, one can
> > do

> > x == eval(repr(x))

> > That is true for many of the builtin data types of the language.

> I totally agree. However if a user types:
> pylab.rcParams
> in IPython, or the Python interpreter, she gets the repr, AFAIK. I would
> like this display to be readable.

OK, this is what I currently have:

"""
In [1]: import simpleconf

In [2]: simpleconf.SimpleConfig()
Out[2]: 
datafile = 'data.txt'   # a value of type 'str' or a value of type 'unicode'
solver = 'Direct'   # 'Direct' or 'Iterative'
Protocol.max_users = 1   # a value of type 'int'
Protocol.ptype = 'http'   # 'http' or 'ftp' or 'ssh'
"""

I would like to make it as easy as possible for users to understand how
to modify configuration options. Comments are welcomed.

Gaƫl

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to