subclassing MatchObject in python
<p>I have been playing around with regular expressions and was trying to subclass the MatchObject that is returned from re.search.</p>

<p>I have had no luck getting access to the MatchObject class.</p>

<p>I assume enter code herethat the actual type of this object is not called "MatchObject":</p>

<pre><code>&gt;&gt;&gt; re.search ("a", "a")
&lt;_sre.SRE_Match object at 0x100427a58&gt;
</code></pre>

<p>However, I am not able get access to this object:</p>

<pre><code>import _sre

dir (_sre)
['CODESIZE', 'MAGIC', '__doc__', '__name__', '__package__', 'compile', 'copyright', 'getcodesize', 'getlower']

&gt;&gt;&gt; dir(_sre.SRE_Match)
Traceback (most recent call last):
File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'module' object has no attribute 'SRE_Match'
</code></pre>

<p>What am I missing?</p>
