nltk / nltk_book

NLTK Book
http://www.nltk.org/book
405 stars 142 forks source link

Remove exercise about `cmp` in chapter 4 #261

Closed lucafrance closed 1 year ago

lucafrance commented 1 year ago

The Python 2 function cmp has been removed Python 3. From https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons

The cmp() function should be treated as gone, and the __cmp__() special method is no longer supported.

This is related to #201

lucafrance commented 1 year ago

Probably also exercise 10 should be removed or updated to use a different function.

Write a program to sort words by length. Define a helper function cmp_len which uses the cmp comparison function on word lengths.

stevenbird commented 1 year ago

Thanks @lucafrance I'd be grateful if you could report that as a separate issue please.