login
Holden Web
What you'll need to know tomorrow

Blogging Python Output: A Challenge

I spent half an hour yesterday in a battle with Bogger, trying to get it to render the output of this Python 3 program:
class MyCls:
pass

obj = MyCls()
print(obj)
Unfortunately, despite batting to with HTML entities for less than and the like, and even changing all spaces to non-breaking spaces*, the best I seem to be able to do is:

<__main__.mycls>

It starts out looking OK, but once I preview it, or publish it, Blogger just throws away everything after the first space up to the closing angle. Who can tell me what I am doing wrong? Or is Blogger being unfair.

* don't even think about blogging the actual entity codes: they'll be mangled too.

[The program will run, producing slightly different output, under Python 2. I suspect Blogger will mangle that output too]