Interesting. I was going to say that because of the way the emacs syntax table works, emacs thinks that the """ and ''' represent the empty line represented by the start of a new line.
You can easily verify this in your copy of emacs by pasting the following code into the python buffer:
class MrsRobinson(object): ''' What that you say? ''' pass
In emacs 23.1.1 [ update: and apparently in stackoveflow!], This completely breaks the syntax highlighting for the rest of the file.
I always use """ specifically to avoid problems with the apostrophe in docstrings, so I havenβt noticed until this minute that in emacs 23.2.1 this is somehow finally fixed ...
(Yes, the new function is called python-quote-syntax in python.el)
So: in your version of emacs this is not possible because strings are not processed correctly. If you upgrade to the latest emacs, you can do this by changing this function in python.el to handle them differently.
tangentstorm
source share