@@ -1623,7 +1623,7 @@ def _normalize_tabular_data(tabular_data, headers, showindex="default"):
16231623 return rows , headers , headers_pad
16241624
16251625
1626- def _wrap_text_to_colwidths (list_of_lists , colwidths , numparses = True ):
1626+ def _wrap_text_to_colwidths (list_of_lists , colwidths , numparses = True , missingval = _DEFAULT_MISSINGVAL ):
16271627 if len (list_of_lists ):
16281628 num_cols = len (list_of_lists [0 ])
16291629 else :
@@ -1646,7 +1646,7 @@ def _wrap_text_to_colwidths(list_of_lists, colwidths, numparses=True):
16461646 # explicit than just `str` of the object. Also doesn't work for
16471647 # custom floatfmt/intfmt, nor with any missing/blank cells.
16481648 casted_cell = (
1649- '' if cell is None else str (cell ) if _isnumber (cell ) else _type (cell , numparse )(cell )
1649+ missingval if cell is None else str (cell ) if _isnumber (cell ) else _type (cell , numparse )(cell )
16501650 )
16511651 wrapped = [
16521652 "\n " .join (wrapper .wrap (line ))
@@ -2247,7 +2247,7 @@ def tabulate(
22472247
22482248 numparses = _expand_numparse (disable_numparse , num_cols )
22492249 list_of_lists = _wrap_text_to_colwidths (
2250- list_of_lists , maxcolwidths , numparses = numparses
2250+ list_of_lists , maxcolwidths , numparses = numparses , missingval = missingval
22512251 )
22522252
22532253 if maxheadercolwidths is not None :
@@ -2261,7 +2261,7 @@ def tabulate(
22612261
22622262 numparses = _expand_numparse (disable_numparse , num_cols )
22632263 headers = _wrap_text_to_colwidths (
2264- [headers ], maxheadercolwidths , numparses = numparses
2264+ [headers ], maxheadercolwidths , numparses = numparses , missingval = missingval
22652265 )[0 ]
22662266
22672267 # empty values in the first column of RST tables should be escaped (issue #82)
0 commit comments