Ticket #14466: trac_14466_fix_type_repr.patch

File trac_14466_fix_type_repr.patch, 714 bytes (added by vbraun, 8 years ago)

Initial patch

  • sage/misc/displayhook.py

    # HG changeset patch
    # User Volker Braun <vbraun.name@gmail.com>
    # Date 1366483725 -3600
    # Node ID df8dbb2d4e5ae7bad7a6f860c0b96ea69498bb5b
    # Parent  3c57d44ab0e4b077a45f7141effe76bcc9d349f7
    Do not use the IPython displayhook for type type (get it? ;-)
    
    diff --git a/sage/misc/displayhook.py b/sage/misc/displayhook.py
    a b  
    143143                [matrix([[1], [2]]), matrix([[3], [4]])])
    144144        '[\n[1]  [3]\n[2], [4]\n]'
    145145    """
     146    if isinstance(obj, type):   
     147        # We don't like IPython's displayhook
     148        return str(obj)
    146149    ascii_art = False
    147150    if isinstance(obj, (tuple, list)) and len(obj) > 0:
    148151        for o in obj: