Fix markup

This commit is contained in:
Raymond Hettinger 2012-04-28 00:51:37 -07:00
parent 9c952d97bf
commit 7cbdcfa301
1 changed files with 10 additions and 6 deletions

View File

@ -841,16 +841,20 @@ Programming Recommendations
whenever they do something other than acquire and release resources. whenever they do something other than acquire and release resources.
For example: For example:
Yes: with conn.begin_transaction(): Yes::
with conn.begin_transaction():
do_stuff_in_transaction(conn) do_stuff_in_transaction(conn)
No: with conn: No::
with conn:
do_stuff_in_transaction(conn) do_stuff_in_transaction(conn)
The latter example doesn't provide any information to indicate that The latter example doesn't provide any information to indicate that
the __enter__ and __exit__ methods are doing something other than the __enter__ and __exit__ methods are doing something other than
closing the connection after a transaction. Being explicit is closing the connection after a transaction. Being explicit is
important in this case. important in this case.
- Use string methods instead of the string module. - Use string methods instead of the string module.