Vladimir wrote: > I understand that you want me to think this way. But that's not my > intuitive thinking. I would have written your example like this: > > def func(file=sys.stdout): > print >> file, args > > This is a clearer, compared to None which is not a file. Sigh. You code doesn't work. Quoting the PEP, from the section that discusses why passing None is the same thing as passing no file at all: "Note: defaulting the file argument to sys.stdout at compile time is wrong, because it doesn't work right when the caller assigns to sys.stdout and then uses tables() without specifying the file." I was sceptical at first, but the more I see of your counter-arguments, the more I support Guido here. As he pointed out, None usually means "pretend I didn't pass this argument" in Python. No difference here. +1 on keeping print as it's implemented (None means default). -1 on making None behave like a NullFile. </F>
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