In python2 bytes is string which is different from the bytes
type in python3. The bytes type from the builtins generalizes
this type to be bytes always. However the redefinition of the
bytes type is marked as Smell in landscape. Thus the code
should at least inform why this is done
The use of six.Iterator as base class for the CommandIterator
seems more clear and explicit compared to the global object
type overwritten by the builtins import. Fixes Smell reported
by landscape
CommandIterator contains already the __iter__ magic method. We don't
need to manually use while and next() in order to advance to the next
element.
=> Code refactored to "for line in self.command" which does exactly the
same job, but is better readable. Plus we avoid the nasty try...except
block.