Python code, self not defined
<pre><code>class makeCode:
    def __init__(self,code):
            self.codeSegment = code.upper()
            if checkSegment(self.codeSegment):
                    quit()
            self.info=checkXNA(self.codeSegment)
    def echo(self,start=0,stop=len(self.codeSegment),search=None): #--&gt; self not defined
            pass
</code></pre>

<p>Not working... </p>

<ul>
<li>it says that the variable <strong>self</strong> is not defined when it actually was; </li>
<li>the function <code>checkSegment</code> returns 1 if the input was not a string made of nucleotids letter, or if that contains nucleotids that can't be together;</li>
<li>it quits if that happens, that's ok it works perfectly; </li>
<li>then it assigns the information (if it's RNA or DNA) checking with the function <code>checkXNA</code> that returns a string with the information "dnaSegment" or "rnaSegment"; works perfectly. </li>
</ul>

<p>But then the function <code>echo</code> which will be designed for printing more specific information tells me that self is not defined, but why? </p>
