[Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-22 Thread Alessandro Guido
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. Thanks. -Ale

Re: [Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Scott David Daniels
Alessandro Guido wrote: > Nick Coghlan wrote: > Eric Smith wrote: >> Because None means 'use the default value'. You probably want: >> print('a', 'b', sep='', end='') > > I think this is a "not optimally designed" API > because you have to read the documentation to understand why Excuse me, I do

Re: [Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Nick Coghlan
Alessandro Guido wrote: > «print strings 'a' and 'b' using the default separator and the default > terminator» > > However i'll just cope with it, Python is still the best language ;) I definitely recommend getting used to this idiom - None is used to indicate missing (i.e. 'use the default val

Re: [Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Eric Smith
[Sorry for the dupes. Lesson: never try and send mail from a moving train.] Eric Smith wrote: > 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.h

Re: [Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Eric Smith
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

Re: [Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Eric Smith
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

Re: [Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Eric Smith
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

Re: [Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Nick Coghlan
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

[Python-Dev] py3k: print function treats sep=None and end=None in an unintuitive way

2008-04-08 Thread Alessandro Guido
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. Thanks. -Ale