Was just discussing how to quickly get a set of all your lights in a scene and thought I'd try some fast mel code, and low and behold it worked..
super easy and fast and works great.
this is one for "meshes" :
sets -name "meshes" `ls -type "mesh"` ;
oh and in python it looks like this