This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author glenflet
Recipients glenflet
Date 2015-04-29.06:44:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430289844.83.0.648544192653.issue24074@psf.upfronthosting.co.za>
In-reply-to
Content
I've only list python 2.7, as I'm not sure that version 3 doesn't accept None, if so this should be changed there too.

If these function are passed None, as the width they should return the string unchanged, just as they would for with a width set to 0.

Reasoning, A common use of these would be in list comprehensions and such, i.e. (string.center(encode(i), w) for i, w in items, widths), given the that items and widths may be of differing length in theory i should be a empty string and width 0 it not specified however the best way of dealing with this would be to use itertools.izip_longest(items, widths, default=None) and None would be encode as No Value, however this would require writing (string.center(encode(i), 0 if w is None else w) for i, w in itertools.izip_longest(items, widths, default=None)), which is far harder to follow, when its quite reasonable to expect these string alignment functions to return an unpadded string if passed None as the width.
History
Date User Action Args
2015-04-29 06:44:04glenfletsetrecipients: + glenflet
2015-04-29 06:44:04glenfletsetmessageid: <1430289844.83.0.648544192653.issue24074@psf.upfronthosting.co.za>
2015-04-29 06:44:04glenfletlinkissue24074 messages
2015-04-29 06:44:04glenfletcreate