diff --git a/case-study-porting-chardet-to-python-3.html b/case-study-porting-chardet-to-python-3.html index 4e4b180..583c708 100644 --- a/case-study-porting-chardet-to-python-3.html +++ b/case-study-porting-chardet-to-python-3.html @@ -625,6 +625,7 @@ ImportError: No module named constants
from . import constants
import sys
There are variations of this problem scattered throughout the chardet library. In some places it’s “import constants, sys”; in other places, it’s “import constants, re”. The fix is the same: manually split the import statement into two lines, one for the relative import, the other for the absolute import.
+
FIXME-xref to as-yet-unwritten PEP 8 style section (which says you should put all imports on their own line)
Onward!
x = MyCustomClass()
+x = MyClass()
x.__init__()
x.my_property
x.__getattribute__("my_property")
-x.my_property
x.__getattr__("my_property")
@@ -214,7 +214,7 @@ AttributeError
my_instance()
my_instance.__call__()
@@ -738,6 +738,8 @@ class FieldStorage:
This is how the [FIXME-xref] with file idiom works.
+
FIXME-xref to as-yet-unwritten section on function annotations +
# excerpt from io.py:
def _checkClosed(self, msg=None):
"""Internal: raise an ValueError if file is closed
diff --git a/table-of-contents.html b/table-of-contents.html
index a176ac0..920c18f 100644
--- a/table-of-contents.html
+++ b/table-of-contents.html
@@ -34,8 +34,6 @@ ul li ol{margin:0;padding:0 0 0 2.5em}
Writing readable code
Everything is an object
@@ -393,6 +391,8 @@ ul li ol{margin:0;padding:0 0 0 2.5em}
- Set comprehensions
- Dictionary comprehensions
- Views (several dictionary methods return them, they're dynamic, update when the dictionary changes, etc.)
+
- Function annotations
+
- PEP 8 style conventions
- Importing modules
- ...mention why from module import * is only allowed at module level