>>>>> "VM" == Vladimir Marangozov <Vladimir.Marangozov@inrialpes.fr> writes: VM> Seems like people are very surprised to see "print >> None" VM> defaulting to "print >> sys.stderr". I must confess that now VM> that I'm looking at it and after reading the PEP, this change VM> lacks some argumentation. sys.stdout, not stderr. I was pretty solidly -0 on this extension, but Guido wanted it (and even supplied the necessary patch!). It tastes too magical to me, for exactly the same reasons you describe. I hadn't thought of the None == /dev/null equivalence, but that's a better idea, IMO. In fact, perhaps the printing could be optimized away when None is used (although you'd lose any side-effects there might be). This would actually make extended print more useful because if you used print >> logfile everywhere, you'd only need to start passing in logfile=None to disable printing. OTOH, it's not to hard to use class Devnull: def write(self, msg): pass logfile=Devnull() We'll have to wait until after the weekend for Guido's pronouncement. -Barry
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