We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d974942 commit ea6a757Copy full SHA for ea6a757
source_py3/python_toolbox/combi/perming/perm.py
@@ -194,8 +194,21 @@ def inverse(self):
194
'''
195
The inverse of this permutation.
196
197
- This means, the permutation such that `perm * ~perm` would be the identity
198
- permutation.
+ i.e. the permutation that we need to multiply this permutation by to
+ get the identity permutation.
199
+
200
+ This is also accessible as `~perm`.
201
202
+ Example:
203
204
+ >>> perm = PermSpace(5)[10]
205
+ >>> perm
206
+ <Perm: (0, 2, 4, 1, 3)>
207
+ >>> ~perm
208
+ <Perm: (0, 3, 1, 4, 2)>
209
+ >>> perm * ~perm
210
+ <Perm: (0, 1, 2, 3, 4)>
211
212
213
if self.is_partial:
214
raise TypeError("Partial perms don't have an inverse.")
0 commit comments