On Wed, May 15, 2013 at 3:43 PM, Oscar Benjamin <oscar.j.benja...@gmail.com>wrote:
> On 15 May 2013 22:21, Marc Tompkins <marc.tompk...@gmail.com> wrote: > > On Wed, May 15, 2013 at 1:02 PM, Alan Gauld <alan.ga...@btinternet.com> > > wrote: > >> > >> And C's printf() returns the number of chars printed. > >> I actually wish python had followed suit because, as Marc says, > >> it can occasionally be useful... > >> > > > > I wonder if this would be a good PEP suggestion? Unlike the switch from > > print to print(), I think this could be done in a future-proof way... > > > > It would be a bit confusing in an interactive session: > > >>> def print_(data): > ... print(data) > ... return len(data) > ... > >>> print_('asd') > asd > 3 > > I was thinking along the lines of an optional parameter ("verbose" or something similar), so print() would supply a return value if you asked it to but keep stumm if you didn't.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor