Hi,

If I do a Cython class

cdef class A:
    def __iter__(self):
        for i in range(5): yield i

then in the console the iterator works fine but not its string representation.

sage: a = A()
sage: iter(a)
KeyError                                  Traceback (most recent call last)
<ipython-input-6-039e95d088f4> in <module>()
----> 1 iter(w)

/opt/sage_flatsurf/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc
in __call__(self, result)
    251             self.write_output_prompt()
    252             format_dict, md_dict = self.compute_format_data(result)
--> 253             self.write_format_data(format_dict, md_dict)
    254             self.update_user_ns(result)
    255             self.log_output(format_dict)

/opt/sage_flatsurf/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc
in write_format_data(self, format_dict, md_dict)
    172         # newline, even if all the prompt separators are ''. This is the
    173         # standard IPython behavior.
--> 174         result_repr = format_dict['text/plain']
    175         if '\n' in result_repr:
    176             # So that multi-line strings line up with the left column of

KeyError: 'text/plain'

Does anybody knows where the problem comes from?

Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to