On 9/5/05, Barry Warsaw <barry at python.org> wrote: > Eliminating the newline argument from print() would reduce the number of > reserved keyword arguments in my strawman by half. Maybe we could even > rename 'to' to '__to__' (!) to eliminate the other namespace wart. Is > this really too horrible: > > print('$user forgot to frobnicate the $file!\n', > user=username, file=file.name, __to__=sys.stderr) Yes, it is too horrible. As I said in another post, __xyzzy__ screams "special internal use, don't mess with this". I don't think the namespace wart is really a problem though; it's simple enough *not* to use 'to' as a variable name in the format. Didn't you mean printf()? (Though I think if the format string doesn't roughly follow C's format string conventions the function shouldn't be called printf().) What do you think of the trick (that I wasn't aware of before) used in Java and .net of putting an optional position specifier in the format, and using positional arguments? It would be a little less verbose and with sensible defaults wouldn't quite punish everybody as much for the needs of i18n. Formats with more than 3 or 4 variables should be rare in any case (these are not the days of Fortran formatted output). -- --Guido van Rossum (home page: http://www.python.org/~guido/)
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