I wonder if there is something similar to,
say:
>>> class A(object):
... def swap(self):
... self = 'I am swapped'
...
>>> abc=A()
>>> abc
<__main__.A object at 0x028B6130>
>>> abc.swap
<bound method A.swap of <__main__.A object at 0x028B6130>>
>>> abc.swap()
>>> abc
<__main__.A object at 0x028B6130>
>>> type(abc)
<class '__main__.A'>
see, it’s type is not str, but Class A.
this is a terrible idea … I do not advocate ever doing this … In fact you should avoid at all costs … look at using a Factory design pattern instead …