gh-38156: just a few details in permutation.py
just a few small codes changes in the modified file, some for pep8
compliance, some for micro-optimisation
### :memo: Checklist
<!-- Put an `x` in all the boxes that apply. -->
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
URL: https://github.com/sagemath/sage/pull/38156
Reported by: Frédéric Chapoton
Reviewer(s): Matthias Köppe