I would prefer calling get_attrs (for lines 172-174), then return just the one attribute like you have in line 175.