title: NLTK FreqDest objects comparison
body: <p>I am new to Python and I came across a code sample using NLTK as below (in IDLE):</p>
  
  <pre><code>&gt;&gt;&gt; letters = nltk.FreqDist('ageqwst')
  &gt;&gt;&gt; words = nltk.corpus.words.words()
  &gt;&gt;&gt; [word for word in words if nltk.FreqDist(word) &lt;= letters]
  </code></pre>
  
  <p>and the output generated showed words that can be made with characters in <code>letters</code>.</p>
  
  <p>I am wondering how <code>nltk.FreqDist(word) &lt;= letters</code> part works. </p>
  
  <p>I looked up <a href="http://nltk.googlecode.com/svn/trunk/doc/api/nltk.probability.FreqDist-class.html" rel="nofollow">NLTK documentation on FreqDist</a> and could not find a satisfying answer. I found out <code>type(letters)</code> returns an object of <code>nltk.probability.FreqDist</code> class and I would like to know how this object comparison works in Python.</p>
  
  <p>Does Python also have an overridable method like JAVA's <code>compareTo</code>?</p>
  
  <p>Thanks,</p>