diff options
author | Georg Brandl <georg@python.org> | 2009-05-22 10:44:31 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-05-22 10:44:31 (GMT) |
commit | fe5f4098acfe3c95fe6489b747a398cba46e734f (patch) | |
tree | 7dde8acf5dc9cb0f91f229b7fbfe0958657786fc /Doc/howto | |
parent | 4f6da63f450459c71f2a22dc7b0351c48f391225 (diff) | |
download | cpython-fe5f4098acfe3c95fe6489b747a398cba46e734f.zip cpython-fe5f4098acfe3c95fe6489b747a398cba46e734f.tar.gz cpython-fe5f4098acfe3c95fe6489b747a398cba46e734f.tar.bz2 |
Recorded merge of revisions 72830 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72830 | georg.brandl | 2009-05-22 12:40:00 +0200 (Fr, 22 Mai 2009) | 1 line
#6086: fix spelling and use a better exception to catch.
........
Diffstat (limited to 'Doc/howto')
-rw-r--r-- | Doc/howto/doanddont.rst | 10 | ||||
-rw-r--r-- | Doc/howto/urllib2.rst | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Doc/howto/doanddont.rst b/Doc/howto/doanddont.rst index 4d3ae88..7f8ceaf 100644 --- a/Doc/howto/doanddont.rst +++ b/Doc/howto/doanddont.rst @@ -30,7 +30,7 @@ Inside Function Definitions ``from module import *`` is *invalid* inside function definitions. While many versions of Python do not check for the invalidity, it does not make it more -valid, no more then having a smart lawyer makes a man innocent. Do not use it +valid, no more than having a smart lawyer makes a man innocent. Do not use it like that ever. Even in versions where it was accepted, it made the function execution slower, because the compiler could not be certain which names are local and which are global. In Python 2.1 this construct causes warnings, and @@ -78,7 +78,7 @@ There are situations in which ``from module import *`` is just fine: from module import name1, name2 ------------------------------- -This is a "don't" which is much weaker then the previous "don't"s but is still +This is a "don't" which is much weaker than the previous "don't"s but is still something you should not do if you don't have good reasons to do that. The reason it is usually bad idea is because you suddenly have an object which lives in two separate namespaces. When the binding in one namespace changes, the @@ -212,11 +212,11 @@ Using the Batteries Every so often, people seem to be writing stuff in the Python library again, usually poorly. While the occasional module has a poor interface, it is usually much better to use the rich standard library and data types that come with -Python then inventing your own. +Python than inventing your own. A useful module very few people know about is :mod:`os.path`. It always has the correct path arithmetic for your operating system, and will usually be much -better then whatever you come up with yourself. +better than whatever you come up with yourself. Compare:: @@ -252,7 +252,7 @@ Using Backslash to Continue Statements ====================================== Since Python treats a newline as a statement terminator, and since statements -are often more then is comfortable to put in one line, many people do:: +are often more than is comfortable to put in one line, many people do:: if foo.bar()['first'][0] == baz.quux(1, 2)[5:9] and \ calculate_number(10, 20) != forbulate(500, 360): diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst index dfa6d0e..8a3accd 100644 --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst @@ -313,7 +313,7 @@ geturl, and info, methods as returned by the ``urllib.response`` module:: >>> req = urllib.request.Request('http://www.python.org/fish.html') >>> try: >>> urllib.request.urlopen(req) - >>> except urllib.error.URLError as e: + >>> except urllib.error.HTTPError as e: >>> print(e.code) >>> print(e.read()) >>> |