python dictionary : unorderable types error
<p>I am adding a generic GDB pretty printer as described <a href="https://www.rethinkdb.com/blog/make-debugging-easier-with-custom-pretty-printers/" rel="nofollow">here</a> to my gdb, the following line adds the map of the types to use the printer:</p>

<pre><code>pretty_printers_dict[re.compile ('.*Generic.*')] = GenericPrinter
</code></pre>

<p>I need to adapt it to my types:</p>

<pre><code>pretty_printers_dict[re.compile ('MyNamespace1.*')] = GenericPrinter
pretty_printers_dict[re.compile ('MyNamespace2.*')] = GenericPrinter
</code></pre>

<p>Basically I like to use the printer for all my types.</p>

<p>But I get the following error inside gdb:</p>

<pre><code>Python Exception &lt;class 'TypeError'&gt; unorderable types: _sre.SRE_Pattern() &lt; _sre.SRE_Pattern(): 
Python Exception &lt;class 'TypeError'&gt; unorderable types: _sre.SRE_Pattern() &lt; _sre.SRE_Pattern(): 
</code></pre>

<p>If I remove either line, it works fine. I am puzzled, </p>

<p>Do you see what problem it is and how to fix it?</p>

<p>[<strong>UPDATE</strong>]
I get away from it by combining the regular expressions:</p>

<pre><code>pretty_printers_dict[re.compile ('MyNamespace1.*|MyNamespace2.*')] = GenericPrinter
</code></pre>