Currently the addAttr-command does not return the attribute that it creates.
In this example the variable "plug" will be empty.
>>> plug = cmds.addAttr("pCube1", longName="myNewAttr")
>>> print plug
What should happen is that addAttr returns the new plug:
>>> plug = cmds.addAttr("pCube1", longName="myNewAttr")
>>> print plug
"pCube1.myNewAttr"
This way there would be no need to do awkward things like this:
>>> some_node = "pCube1"
>>> attr = "myNewAttr"
>>> cmds.addAttr(some_node, longName=attr)
>>> plug = "{}.{}".format(some_node, attr)
I imagine this must be a quick and easy fix and it would be very appreciated by many TDs.