Movatterモバイル変換
[0]ホーム
[Python-Dev] accept string in a2b and base64?
Antoine Pitrousolipsis at pitrou.net
Tue Feb 21 13:28:07 CET 2012
On Tue, 21 Feb 2012 12:51:08 +1000Nick Coghlan <ncoghlan at gmail.com> wrote:>> My one concern with the base64 patch is that it doesn't test that> mixing types triggers TypeError. While this shouldn't require any> extra code (the error should arise naturally from the method> implementation), it should still be tested explicitly to ensure type> mismatches fail as expected.I don't think mixing types is a concern. The extra parameters to thebase64 functions aren't mixed into the original string, they are used tomodify the decoding algorithm.So it's like typing `open(b"LICENSE", "r")`: the fast that `b"LICENSE"`is bytes while `"r"` is str isn't really a problem.RegardsAntoine.
More information about the Python-Devmailing list
[8]ページ先頭