__doc__ = u"""
-try:
- eggs().eat()
-except RuntimeError, e:
- print "%s: %s" % (e.__class__.__name__, e)
+>>> try:
+... eggs().eat()
+... except RuntimeError:
+... import sys
+... e = sys.exc_info()[1]
+... print("%s: %s" % (e.__class__.__name__, e))
+RuntimeError: I don't like that
"""
cdef class eggs:
pass
def eat(self):
- raise RuntimeError("I don't like that")
+ raise RuntimeError(u"I don't like that")
__doc__ = u"""
-g = r_lepage_3.Grail()
-g("spam", 42, ["tomato", "sandwich"])
+>>> g = Grail()
+>>> g("spam", 42, ["tomato", "sandwich"])
+Grail called with: spam 42 ['tomato', 'sandwich']
"""
cdef class Grail:
def __call__(self, x, y, z):
- print "Grail called with:", x, y, z
+ print u"Grail called with:", x, y, z