[PEP 278] > > A partial output implementation, where strings passed to fp.write() > > would be converted to use fp.newlines as their line terminated but > > all other output would not is far too surprising, in my view. > > > > Because there is no output support for universal newlines there is > > also no support for a mode "rU+": the surprise factor of the > > previous paragraph would hold to an even stronger degree. [Gustavo] > I've read that, but I don't agree with the second paragraph. Universal > newline support is available only for input. This sentence is enough to > easily predict the behavior in every usage case, including "+" modes. > > If there's any intent to add support to output, then I'd understand > the exclusion, since this would make backwards compatibility possible > (users of "rU+" could have their code broken, since they were doing > output by hand). Otherwise, it should be allowed, IMO. That's one possible reason not to do this. It could be added later, but I think it's better to disallow it for now. Think YAGNI. --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