ipython/ipython — pull request #2302 by takluyver (2012-08-14 16:55:14+00:00)
Title: Fix variable expansion on 'self'

Following discussion on #1878, I found that the variable expansion for magic and system commands dropped 'self' for technical reasons (calling with `**kwargs`, self causes a collision with the method's 'self' variable).

It's fairly important that we can expand `self`, because it's a very common variable. Happily there was an easy workaround - formatters have a `vformat` method, which accepts a dictionary rather than kwargs.

There's also a test, naturally.