cube = maya.cmds.polyCube()[0]
maya.cmds.parent(cube, world = True)
# Warning: Object, 'pCube1', skipped. It is already a child of the parent, 'world'. #
# Error: Maya command error
# Traceback (most recent call last):
# File "<maya console>", line 3, in <module>
# RuntimeError: Maya command error #
However... having said that, I also tried the mel command (since it seemed odd that it would throw a warning AND an error), and that did NOT error - it only gave the warning. So my guess is that there's an error in Autodesk's implementation of the python maya.cmds.parent cmd, which pymel relies on.
Of course, it would be possible to make pymel behave like the mel command, and not throw an error in this situation. However, I'm not sure it's clear in which manner it SHOULD behave in this case (ie, should it emulate the behavior of the python or mel command?)... so I'd lean towards leaving it the way it is, since that won't break anyone's existing code...
- Paul