[lxml-dev] naming the lxml.html parse functions

Stefan Behnel stefan_ml at behnel.de
Mon Jul 9 22:52:19 CEST 2007


Ian Bicking wrote:
> Stefan Behnel wrote:
>> Ian Bicking wrote:
>>> HTMLFragment() bothers me more because
>>> it definitely doesn't return a different type of object from HTML(), but
>>> the naming implies it does.
>>
>> Hmmm, I don't really feel the same way, but maybe I'm too biased
>> already. :)
>>
>> It's Python after all, so the actual type is not that relevant.
> 
> Yes, but we're already badly abusing naming conventions.  These aren't
> classes, but they are named like classes.  This has caused confusion for
> me in the past.

Ok, I buy that. But what would be the alternative?

  * element_from_string(s) and elements_from_string(s)
  * fragment_from_string(s) and fragments_from_string(s)
  * parse_element_string(s) and ???
  * parse_string_element(s) and parse_string_elements(s)

I could maybe live with the first.

Stefan


More information about the lxml-dev mailing list