<p>First, you are not creating your permutation correctly. The correct syntax, best seen on page 23 in <a href="https://arxiv.org/pdf/1307.7042.pdf" rel="nofollow noreferrer">your link</a>, is</p>

<pre><code>a = Perm()(1, 2, 3)(4, 15, 6)(7, 8, 9)
</code></pre>

<p>Next, that module is set up so that theoretically it permutes all non-negative integers, with finitely many of them mapping to values other than themselves. So theoretically there is no highest number in a permutation in that module. As your link states on page 5,</p>

<blockquote>
  <p>The perm size <em>n</em> is undeﬁned because keys not deﬁned explicitly are equal to their values (<em>p[i] == i</em>).</p>
</blockquote>

<p>So in one respect your quest to "extract the highest number from a permutation" is meaningless. However, at any given time, the data structure representing a permutation in that module does have a largest number. The module tries to hide that information from the user, to keep the theoretical viewpoint of acting on all non-negative integers. But since the <code>Perm</code> class is derived from the <code>dict</code> built-in type, you can find the current highest number in that structure with</p>

<pre><code>highestnum = max(a)
</code></pre>

<p>In your example, that does return the value <code>15</code>. But be aware that the largest value could easily change, without changing the permutation that is being represented. For example, if you execute <code>print(a[20])</code>, that does not seem to change the permutation <code>a</code>, and comparing the value of <code>a</code> to its previous value using <code>==</code> yields <code>True</code>. But now <code>max(a)</code> yields the value <code>20</code>. Thus <code>max(a)</code> is not consistent and depends on the current internal representation of the permutation, so it is not wise to use this value.</p>

<p>Fortunately, you can find a more consistent "highest number", namely the highest number that is changed by the permutation:</p>

<pre><code>highestnum = a.max()
</code></pre>

<p>This also returns the result you want, <code>15</code>. Accessing <code>a[20]</code> or any other value does not change <code>a.max()</code>, so you should satisfy yourself with the <code>max()</code> value.</p>

<p>By the way, regarding your linked document, here is <a href="http://ojs.pythonpapers.org/index.php/tpp/article/viewFile/258/229" rel="nofollow noreferrer">a better link</a> to the documentation, which is a finished version of the pre-print you linked to. And here is <a href="https://code.google.com/archive/p/perms-dict/source/default/source" rel="nofollow noreferrer">a link to the source code</a>. However, I referred to your link in what I wrote above. The Python code in that document uses Python 2.6: I made some changes so it runs in Python 3.7 and used that to check my answer.</p>
How to find largest number in a permutation in python?
<p>I want to extract the highest number from a permutation. I am using the groups module right now so the output in the below code should be 15 </p>

<pre><code>
from groups import *

a = Perm((1, 2, 3), (4, 15, 6), (7, 8, 9))

max([x for x in a])
</code></pre>