summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-02-20 03:31:23 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-02-20 03:31:23 (GMT)
commita7b55a33f877d1c210a5372a73ad85983ab8621c (patch)
treeccff5a2b2506f9b290e8c9f83be33bb3dfc16655 /Doc/howto
parent5149742e8b3c8221d4cb53dcfc9a12ae3fec9238 (diff)
downloadcpython-a7b55a33f877d1c210a5372a73ad85983ab8621c.zip
cpython-a7b55a33f877d1c210a5372a73ad85983ab8621c.tar.gz
cpython-a7b55a33f877d1c210a5372a73ad85983ab8621c.tar.bz2
revert r69777 since all the experts agree that extra import lines distract from the code
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/doanddont.rst3
-rw-r--r--Doc/howto/webservers.rst7
2 files changed, 3 insertions, 7 deletions
diff --git a/Doc/howto/doanddont.rst b/Doc/howto/doanddont.rst
index b4f271e..a56fb8c 100644
--- a/Doc/howto/doanddont.rst
+++ b/Doc/howto/doanddont.rst
@@ -267,8 +267,7 @@ sequence with comparable semantics, for example, yet many people write their own
:func:`max`/:func:`min`. Another highly useful function is :func:`reduce`. A
classical use of :func:`reduce` is something like ::
- import operator
- import sys
+ import sys, operator
nums = map(float, sys.argv[1:])
print reduce(operator.add, nums)/len(nums)
diff --git a/Doc/howto/webservers.rst b/Doc/howto/webservers.rst
index 1b8e041..6e0c815 100644
--- a/Doc/howto/webservers.rst
+++ b/Doc/howto/webservers.rst
@@ -99,8 +99,7 @@ simple CGI program::
# -*- coding: UTF-8 -*-
# enable debugging
- import cgitb
- cgitb.enable()
+ import cgitb; cgitb.enable()
print "Content-Type: text/plain;charset=utf-8"
print
@@ -280,9 +279,7 @@ following WSGI-application::
# -*- coding: UTF-8 -*-
from cgi import escape
- import os
- import sys
-
+ import sys, os
from flup.server.fcgi import WSGIServer
def app(environ, start_response):