diff --git a/porting-code-to-python-3-with-2to3.html b/porting-code-to-python-3-with-2to3.html index 7a7d8a5..7d64e62 100644 --- a/porting-code-to-python-3-with-2to3.html +++ b/porting-code-to-python-3-with-2to3.html @@ -157,8 +157,8 @@ td pre{padding:0;border:0}
or operator takes precedence over the in operator, so there is no need for parentheses here.
or takes precedence over in.
-in operator takes precedence over the + operator, so this form needs parentheses too.
-in operator takes precedence over the + operator, so this form technically doesn’t need parentheses, but 2to3 includes them anyway.
+in operator takes precedence over the + operator.
In Python 2, many dictionary methods returned lists. The most frequently used methods were keys(), items(), and values(). In Python 3, all of these methods return dynamic views. In some contexts, this is not a problem. If the method’s return value is immediately passed to another function that iterates through the entire sequence, it makes no difference whether the actual type is a list or a view. In other contexts, it matters a great deal. If you were expecting a complete list with individually addressable elements, your code will choke, because views do not support indexing.
diff --git a/your-first-python-program.html b/your-first-python-program.html
index 53f56f5..2aa0582 100644
--- a/your-first-python-program.html
+++ b/your-first-python-program.html
@@ -150,12 +150,6 @@ SyntaxError: non-keyword arg after keyword arg
-☞Many Python IDEs use the
docstringto provide context-sensitive documentation, so that when you type a function name, itsdocstringappears as a tooltip. This can be incredibly helpful, but it’s only as good as thedocstrings you write.
In case you missed it, I just said that Python functions have attributes, and that those attributes are available at runtime. A function, like everything else in Python, is an object.
Run the interactive Python shell and follow along: