lxml/lxml — pull request #48 by SimonSapin (2012-04-23 09:16:34+00:00)
Title: Add a cssselect method to all elements, not just HtmlElement

Submit #47 again, without all the clutter from #46.

This is a partial fix for #45. (Elements get a `cssselect()` method but are still not known to be HTML. You might need to pass `translator='html'`.)

@scoder already [commented](https://github.com/lxml/lxml/pull/47#commitcomment-1237759) on two downsides:

* It suggests bad practices for efficiency (the selector is compiled on every call)
* It is too tightly integrated for something that needs an optional, external library

I think that both of these issues can be addressed with documentation, and the convenience can be worth it in some cases. (For example, pre-compiling will not help a selector that is used only once in a test suite.)