[lxml-dev] lhtml
Stefan Behnel
stefan_ml at behnel.de
Fri May 25 08:14:30 CEST 2007
Hi Ian,
Ian Bicking wrote:
> Ian Bicking wrote:
>> I really want to take all our HTML-related routines and put them into a
>> proper package
>
> And maybe a bit of advice -- we could just do this as a set of functions
> (what we currently have), or potentially explore objectify and add the
> routines as methods. E.g., el.find_by_class('classname')
You're not using objectify as a base, are you? I mean, HTML is mainly about
text, so objectify will not help you much.
> This feels like a cleaner API, but I'm worried that it will mean
> problems when mixing non-objectify-HTML with other elements, and if
> there's problems with threads or memory overhead, or any other issues.
> I don't really mind functions, which is why I am unsure; OTOH, almost
> every function has a first argument of "el", which makes them seem like
> methods.
What about implementing the HTML namespace in a couple of Element subclasses
and add the methods where they are appropriate? That sounds like a nice API to me.
Any chance you could post your code somewhere so that I could take a look at
what you're really contributing here?
Stefan
More information about the lxml-dev
mailing list