He's using the incorrect datatype for ap_list. This is apprently the collection of AP's already seen, and used with this pattern:<p><pre><code> ap_list = []
if AP not in ap_list:
ap_list.append(AP)
print AP
</code></pre>
It works, but does a linear scan every time. It's better to use a set() in such a case:<p><pre><code> ap_seen = set()
if AP not in ap_seen:
ap_seen.add(AP)
print AP
</code></pre>
For looking up things, a set (essentially a dict without values) is much quicker than a list. Is this premature optimisation? Perhaps, but using a list for this purpose is also a code smell.
Is there a problem/drawback with "iw phy phy0 interface add mon0 type monitor" besides using the airmon tool to create a monitor interface? It works nicely with the iw command.