@@ -770,9 +770,9 @@ An example of writing to a configuration file::
770770 # values using the mapping protocol or ConfigParser's set() does not allow
771771 # such assignments to take place.
772772 config.add_section('Section1')
773- config.set('Section1', 'int ', '15')
774- config.set('Section1', 'bool ', 'true')
775- config.set('Section1', 'float ', '3.1415')
773+ config.set('Section1', 'an_int ', '15')
774+ config.set('Section1', 'a_bool ', 'true')
775+ config.set('Section1', 'a_float ', '3.1415')
776776 config.set('Section1', 'baz', 'fun')
777777 config.set('Section1', 'bar', 'Python')
778778 config.set('Section1', 'foo', '%(bar)s is %(baz)s!')
@@ -790,13 +790,13 @@ An example of reading the configuration file again::
790790
791791 # getfloat() raises an exception if the value is not a float
792792 # getint() and getboolean() also do this for their respective types
793- float = config.getfloat('Section1', 'float ')
794- int = config.getint('Section1', 'int ')
795- print(float + int )
793+ a_float = config.getfloat('Section1', 'a_float ')
794+ an_int = config.getint('Section1', 'an_int ')
795+ print(a_float + an_int )
796796
797797 # Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.
798798 # This is because we are using a RawConfigParser().
799- if config.getboolean('Section1', 'bool '):
799+ if config.getboolean('Section1', 'a_bool '):
800800 print(config.get('Section1', 'foo'))
801801
802802To get interpolation, use :class: `ConfigParser `::
0 commit comments