On Tue, 14 Jan 2014 10:52:05 -0800 Guido van Rossum <guido at python.org> wrote: > Would you rather raise an exception, truncate the > value, or mess up the formatting? All languages newer than Fortran > that I've used have chosen the latter, and I still agree it's a good > idea. Well that's useful when printing out human-readable stuff on stdout, much less when you're emitting binary data that's supposed to conform to a well-defined protocol. I expect bytes formatting to be used for the latter, not the former. (which also means, actually, that I don't think the fancy formatting features - alignment, etc. - are useful at all for bytes; but it's probably ok having them for consistency) > Similar with infinities, NaN, or None. (Yes, it's embarrassing > to have a website displaying 'null'. But isn't a 500 even *more* > embarrassing?) When it comes to type mismatch, though, an error is raised: >>> "%d" % object() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: %d format: a number is required, not object (instead of outputting e.g. repr(id(x))) Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4