Alessandro Guido wrote: > Can anybody please point me why print('a', 'b', sep=None, end=None) should > produce "a b\n" instead of "ab"? > I've read http://docs.python.org/dev/3.0/library/functions.html#print, > pep-3105 and some > ml threads but did not find a good reason justifying such a strange behaviour.
So that print(a, b) does the right thing (i.e. matches the Python 2.x print statement's behaviour) sep=None, end=None means "use the default separator and line ending" rather than "don't use a separator or line ending" (this is the same as for most functions with optional arguments - you need to look at the documentation of the function to find out what default values are used when passing None for an optional argument). That said, it does read oddly, so I'd advise against writing it out explicitly like that - if you want the default, just leave out the relevant argument. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com