Skip to content

Information on pre2to3 branch

goertzenator edited this page Feb 8, 2011 · 4 revisions

The purpose of the pre2to3 branch is to clean up Paramiko for Python 2 so that the 2to3 tool runs with fewer errors and silly changes.

The changes applied are:

  • Most range() changed to xrange(). xrange() was already being used in some places.
  • Some keys() changed to iterkeys().
  • Some values() changed to itervalues().
  • Some type checking of the form type(x) is long changed to isinstance(x, long)

The above changes are compatible back to 2.2, so there should be no issues with merging these to Paramiko master. These changes should also increase performance since many large lists are now iterators.

More Changes:

  • Change UserDict.DictMixin to collections.MutableMapping. Breaks compatibility with <2.4
  • Removed has_key() tests for HostKeys class because has_key() is deprecated, and is not implemented by the underlying MutableMapping class.
Clone this wiki locally