|
From: Helmut G. <h.g...@cy...> - 2011-02-28 15:45:59
|
Hi,
Please CC me in a reply, because I am not subscribed to the mailing
list.
The documentation section 5.1.2.3[1] explains how to force all values of a
section to have the same type.
I tried this using the following example.
***snip***
import configobj
import validate
spec = configobj.ConfigObj("""
[test]
__many__ = integer
""".splitlines(), interpolation=False, list_values=False)
config = configobj.ConfigObj("""
[test]
spam = not an integer
""".splitlines(), configspec=spec)
print config.validate(validate.Validator())
***snip***
The expected outcome would be False, because spam is "not an integer".
The observed outcome in contrast is True. Changing __many__ to spam
gives the expected outcome False.
So what is wrong here?
Helmut
[1] http://www.voidspace.org.uk/python/configobj.html#id43
|