Python Class Attributes: An Overly Thorough Guide

2018-05-21 26 min read Uncategorized

This article is originally published at Toptal.

I had a programming interview recently, a phone-screen in which we used a collaborative text editor.

I was asked to implement a certain API, and chose to do so in Python. Abstracting away the problem statement, let’s say I needed a class whose instances stored some 

  <td>
    <div class="text codecolorer">
      data
    </div>
  </td>
</tr>
1

 and some 

  <td>
    <div class="text codecolorer">
      other_data
    </div>
  </td>
</tr>
1

.

Continue reading