Proposal: make new 'class_' etc. function arguments

14 views
Skip to first unread message

Pavel Potoček

unread,
Dec 19, 2011, 10:29:41 AM12/19/11
to beautifulsoup
I'm not sure if feature proposals fit in here, but I'll give it a
try:)

As is written in PEP 8, when the name of variable collides with a
keyword, use trailing underscore.

It would be nice if this feature was implemented also in
BeautifulSoup.

Yes I know that for this case there is an alternative construction
{"class": "foo"}, but this is waay too long to write:]. Trailing
underscores would be logical and I would like them very much:) I'm
sure others would anticipate 'em too.

And it's also PEP-conformal. :)

Aaron DeVore

unread,
Dec 19, 2011, 12:39:09 PM12/19/11
to beauti...@googlegroups.com
Not a comment on your proposal, just pointing this out: As a shortcut,
you can search by class name by using something like:

tag.findAll('tag-name', 'class-name')

It works for all find* searches.

2011/12/19 Pavel Potoček <pavelp...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "beautifulsoup" group.
> To post to this group, send email to beauti...@googlegroups.com.
> To unsubscribe from this group, send email to beautifulsou...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/beautifulsoup?hl=en.
>

Reply all
Reply to author
Forward
0 new messages