80: Cleaned up docstring for option.normalize()

This commit is contained in:
Jason Gerard DeRose 2008-08-08 16:43:24 +00:00
parent b3fc5f9a41
commit f656e31a7e

View File

@ -52,14 +52,17 @@ class option(object):
))
__rules = None
# type = unicode, int, float # Set in subclass
def normalize(self, value):
"""
Normalize an input value. The base class implementation only does
type coercion, but subclasses might do other normalization (e.g., a
str option might strip leading and trailing white-space).
Returns the normalized form of `value`. If `value` cannot be
normalized, NormalizationError is raised, which is a subclass of
ValidationError.
If value cannot be normalized, NormalizationError is raised, which
is a subclass of ValidationError.
The base class implementation only does type coercion, but subclasses
might do other normalization (e.g., a unicode option might strip
leading and trailing white-space).
"""
try:
return self.type(value)