title: define different function for different versions of python
body: <p>Is there any way to define a different function (with the same body) for different version of python?</p>
  
  <p>specifically, for python 2.7 define:</p>
  
  <pre><code>def __unicode__(self): 
  </code></pre>
  
  <p>and for python 3 define:</p>
  
  <pre><code>def __str__(self):
  </code></pre>
  
  <p>but both will have the same code / body. both must also be a member of class.</p>