Pickling an HTMLParser object fails.
The following test demonstrates the behavior I was expecting:
def test_pickle_parser():
parser = HTMLParser()
encoded = pickle.dumps(parser)
decoded = pickle.loads(encoded)
...
This is failing because the *Phase classes are not defined at the top-level, but instead are defined inside the factory function getPhases(). (This pattern exists in the treebuilders directory as well.)
Unless there is a reason to never reuse a parser, I think the object should be pickleable.