Yes, PyMel is crap. It's the best crap you get in Maya, but it's still crap. Take a look:
This SETS a value. And this
RETURNS a value. Finally this
delivers an ERROR. This is not how you're supposed to use Python ffs!!!
Also the "sets"-command is an abomination in Maya python. Actually, it's already in MEL, but at least it sorta follows the idiotic MEL-logic. In python it just batshit crazy. To remove an object from a set, you do this:
cmds.sets( myObject, remove=mySet )
Yes. You tell the "sets"-command to remove the mySet from myObject to actually remove myObject from mySet... head explodes... Oh yea, in pyMel it seems to not accept it's own objects anymore... I give up.