next_permutation is a C++ function which gives the lexicographically next permutation of a string. Details about its implementation can be obtained from this really awesome post. http://wordaligned.org/articles/next-permutation

  1. Is anyone aware of a similar implementation in Python?
  2. Is there a direct python equivalent for STL iterators?
Edit
Report