diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-09-29 12:03:12 -0700 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-09-29 12:03:12 -0700 |
commit | 3547a348ebc6defc5b1620ce2310070df3885c42 (patch) | |
tree | 7e6e453b1af4e12c83775bbfe5afbb9372c8298e | |
parent | 0798cbc1df56e7e681acac755a59d80a6ff60a9b (diff) | |
parent | fab57ccd1307deb8c803149de7f5b0e9ea5726b5 (diff) | |
download | cpython-git-3547a348ebc6defc5b1620ce2310070df3885c42.tar.gz |
merge heads
-rw-r--r-- | Doc/library/configparser.rst | 14 | ||||
-rw-r--r-- | Doc/library/functions.rst | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index c72908a3f2..515074ae04 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -451,9 +451,9 @@ An example of writing to a configuration file:: # when attempting to write to a file or when you get it in non-raw # mode. SafeConfigParser does not allow such assignments to take place. config.add_section('Section1') - config.set('Section1', 'int', '15') - config.set('Section1', 'bool', 'true') - config.set('Section1', 'float', '3.1415') + config.set('Section1', 'an_int', '15') + config.set('Section1', 'a_bool', 'true') + config.set('Section1', 'a_float', '3.1415') config.set('Section1', 'baz', 'fun') config.set('Section1', 'bar', 'Python') config.set('Section1', 'foo', '%(bar)s is %(baz)s!') @@ -471,13 +471,13 @@ An example of reading the configuration file again:: # getfloat() raises an exception if the value is not a float # getint() and getboolean() also do this for their respective types - float = config.getfloat('Section1', 'float') - int = config.getint('Section1', 'int') - print float + int + a_float = config.getfloat('Section1', 'a_float') + an_int = config.getint('Section1', 'an_int') + print a_float + an_int # Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'. # This is because we are using a RawConfigParser(). - if config.getboolean('Section1', 'bool'): + if config.getboolean('Section1', 'a_bool'): print config.get('Section1', 'foo') To get interpolation, you will need to use a :class:`ConfigParser` or diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index a1f7534b43..25d09d1a81 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1100,7 +1100,7 @@ available. They are listed here in alphabetical order. except StopIteration: raise TypeError('reduce() of empty sequence with no initial value') accum_value = initializer - for x in iterable: + for x in it: accum_value = function(accum_value, x) return accum_value |