Show More
@@ -636,7 +636,6 b' class PlainTextFormatter(BaseFormatter):' | |||||
636 |
|
636 | |||
637 | This parameter can be set via the '%precision' magic. |
|
637 | This parameter can be set via the '%precision' magic. | |
638 | """ |
|
638 | """ | |
639 |
|
||||
640 | new = change['new'] |
|
639 | new = change['new'] | |
641 | if '%' in new: |
|
640 | if '%' in new: | |
642 | # got explicit format string |
|
641 | # got explicit format string | |
@@ -678,6 +677,11 b' class PlainTextFormatter(BaseFormatter):' | |||||
678 | def _type_printers_default(self): |
|
677 | def _type_printers_default(self): | |
679 | d = pretty._type_pprinters.copy() |
|
678 | d = pretty._type_pprinters.copy() | |
680 | d[float] = lambda obj,p,cycle: p.text(self.float_format%obj) |
|
679 | d[float] = lambda obj,p,cycle: p.text(self.float_format%obj) | |
|
680 | # if NumPy is used, set precision for its float64 type | |||
|
681 | if "numpy" in sys.modules: | |||
|
682 | import numpy | |||
|
683 | ||||
|
684 | d[numpy.float64] = lambda obj, p, cycle: p.text(self.float_format % obj) | |||
681 | return d |
|
685 | return d | |
682 |
|
686 | |||
683 | @default('deferred_printers') |
|
687 | @default('deferred_printers') |
General Comments 0
You need to be logged in to leave comments.
Login now