diff --git a/IPython/utils/text.py b/IPython/utils/text.py index 1a081626e01..cc6dce46ac7 100644 --- a/IPython/utils/text.py +++ b/IPython/utils/text.py @@ -556,6 +556,9 @@ def _vformat(self, format_string, args, kwargs, used_args, recursion_depth): # the formatting if format_spec: + if conversion: + # override conversion spec + field_name = '!'.join([field_name, conversion]) # override format spec, to allow slicing: field_name = ':'.join([field_name, format_spec]) @@ -761,4 +764,4 @@ def get_text_list(list_, last_sep=' and ', sep=", ", wrap_item_with=""): return list_[0] return '%s%s%s' % ( sep.join(i for i in list_[:-1]), - last_sep, list_[-1]) \ No newline at end of file + last_sep, list_[-1])