This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tebeka
Recipients rhettinger, tebeka
Date 2009-02-03.06:47:19
SpamBayes Score 0.00021251835
Marked as misclassified No
Message-id <1233643642.65.0.518305173393.issue4124@psf.upfronthosting.co.za>
In-reply-to
Content
Hmmm, too much time has passed and my 1bit memory has overflowed since :)

IIRC it has to do with the fact that not all nodes in BeautifulSoup has a
"name" attribute. I wanted to count how may "tr" there were, so
    len(filter(lambda n: n == "tr", map(attrgetter("name"), soup))) 
was what I wanted to do, but I got AttributeError.

The natural way to me would be 
    len(filter(lambda n: n == "tr", map(attrgetter("name", ""), soup))) 
but instead I had to do
    len(filter(lambda n: n == "tr", map(lambda n: gettattr(n, "name", ""),
soup)))

Another thing I can think of is for usage in count/max ... when some of the
objects don't have the attribute you're looking for and it's by design
(bad one
maybe).

You'd like to be able to do:
    max(map(itemgetter("time", 0)), articles)
History
Date User Action Args
2009-02-03 06:47:22tebekasetrecipients: + tebeka, rhettinger
2009-02-03 06:47:22tebekasetmessageid: <1233643642.65.0.518305173393.issue4124@psf.upfronthosting.co.za>
2009-02-03 06:47:21tebekalinkissue4124 messages
2009-02-03 06:47:19tebekacreate