rushter / selectolax

Python binding to Modest and Lexbor engines (fast HTML5 parser with CSS selectors).
MIT License
1.11k stars 68 forks source link

'Node.unwrap_tags' accepts only 'list' as argument #28

Closed mush42 closed 4 years ago

mush42 commented 4 years ago

Hi,

I don't know if this has any effect, but 'Node.unwrap_tags' should accept any iterable rather than only lists.

The following exception is raised when calling Node.unwrap_tags with a set:

    html.body.unwrap_tags({'a', 'span', 'div',})
TypeError: Argument 'tags' has incorrect type (expected list, got set)
rushter commented 4 years ago

I'm not sure if it makes sense to allow arbitrarily iterables. It's strongly typed for speed. We need to benchmark it.

mush42 commented 4 years ago

Got it. I'm willing to work under some constraints if it make things faster.