1+ ietfdb (5.2.0) ietf; urgency=low
2+
3+ This is a code cleanup release. It adds a test and a managemement command
4+ to run pyflakes (pyflakes is a bit like 'lint' for Python) over the
5+ datatracker code, and cleans up the code so that it tests clean. The number
6+ of lines changed is large, but the changes to what the code actually does is
7+ limited to fixing bugs discovered by pyflakes during the cleanup. There
8+ were around 10 such cases.
9+
10+ Most of the changes are related to import statements, as the code otherwise
11+ was pretty clean already. In almost all places, bulk imports using '*' has been
12+ replaced by explicit imports, for these reasons:
13+
14+ * It makes it clear from where an imported name has come, so that a
15+ human reader can look for an identifier in the import statements, and
16+ see from where it comes, and where he should go to inspect the related
17+ code.
18+
19+ * It makes it clear to the interpreter exactly which symbol is intended,
20+ in cases where the same symbol is defined in multiple modules imported
21+ using '*' import. This is not a common case, but it actually turned up
22+ a couple of times during the cleanup. If the '*' imports in question
23+ hadn't been turned into explicit imports, only the (somewhat arbitrary)
24+ order of the import statements would have determine which instance of a
25+ function or class would actually be visible to the following code. This
26+ situation can make the code do something different from what was intended,
27+ in a quite devious way.
28+
29+ * It avoids unintended import of generically named variables from other
30+ modules. Altough having such variables as module globals is a bad
31+ practice, it happens, and sometimes unintentionally importing them
32+ through a '*' import will make it appear to the interpreter that a
33+ statement intended to use an (by mistake undefined) identically named
34+ local variable is in fact a valid statement which uses the imported
35+ symbol instead. Without the '*' import, the situation would be
36+ correctly flagged by the interpreter.
37+
38+ * Finally, importing all symbols explicitly makes it possible for pyflakes
39+ to do a better job in identifying unused and undefined symbols -- in the
40+ presence of '*' imports, this capability becomes much more limited.
41+ Several cases of bad code (use of undefined variables) was discovered
42+ during the cleanup only after the '*' imports were replaced by explicit
43+ imports.
44+
45+ In many places, the import statements have been reordered to consistently
46+ list the generic python library imports first, followed by django imports,
47+ then local module imports (these typically live on the same level as ietf/
48+ and django/), finally followed by datatracker-specific imports. Some people
49+ find that this kind of consistency in importing, both in keeping a consistent
50+ order, and in importing in a sequence from the more general down to the more
51+ specific, aids in the readability of the code.
52+
53+ -- Henrik Levkowetz <henrik@levkowetz.com> 16 Mar 2014 20:52:05 +0100
54+
55+
156ietfdb (5.1.1) ietf; urgency=medium
257
358 This is a minor bugfix release, in preparation for merging the pyflakes test
@@ -20,6 +75,7 @@ ietfdb (5.1.1) ietf; urgency=medium
2075
2176 -- Henrik Levkowetz <henrik@levkowetz.com> 18 Mar 2014 22:49:58 +0100
2277
78+
2379ietfdb (5.1.0) ietf; urgency=high
2480
2581 This release contains the datatracker bugfixes and enhancements from the
0 commit comments