nltk/nltk — pull request #208 by heatherleaf (2012-02-05 22:16:28+00:00)
Title: Trees are not lists

This pull reqeust is silghtly more experimental than the others.

Since trees do not work like lists, I think it's better to make trees a subclass of a generic Sequence class. Instead of `list` I chose `collections.MutableSequence` as superclass of Tree. The tree children are now stored in the property `.children`, but the standard sequence methods and selectors work directly on the tree, just as before.

I hope no existing code will break, and that the new code is more intuitive than before. The doctests pass without problems.

This only changes the files tree.py and tree.doctest -- the other changes are the same as my previous pull request:
https://github.com/nltk/nltk/pull/207