Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3547a348
Commit
3547a348
authored
Sep 29, 2012
by
Gregory P. Smith
Browse files
Options
Browse Files
Download
Plain Diff
merge heads
parents
0798cbc1
fab57ccd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Doc/library/configparser.rst
Doc/library/configparser.rst
+7
-7
Doc/library/functions.rst
Doc/library/functions.rst
+1
-1
No files found.
Doc/library/configparser.rst
View file @
3547a348
...
...
@@ -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
...
...
Doc/library/functions.rst
View file @
3547a348
...
...
@@ -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 it
erable
:
for x in it:
accum_value = function(accum_value, x)
return accum_value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment