Incorrect example in documentation, tag['class'] returns a list

Bug #1631743 reported by lonf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Beautiful Soup
Fix Released
Undecided
Unassigned

Bug Description

The documentation at https://www.crummy.com/software/BeautifulSoup/bs4/doc/#attributes gives the following example:

tag['class']
# u'boldest'

but the actual result is a list:

tag['class']
# ['boldest']

Also in the next example

tag.attrs

returns {'class': ['boldest']} instead of {u'class': u'boldest'}.

lonf (lonf)
description: updated
Revision history for this message
Leonard Richardson (leonardr) wrote :

Revision 431 corrects the documentation.

Changed in beautifulsoup:
status: New → Fix Committed
Changed in beautifulsoup:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.