[Tutor] Making a Primary Number List generator

Oscar Benjamin oscar.j.benjamin at gmail.com
Thu May 16 00:43:57 CEST 2013


On 15 May 2013 22:21, Marc Tompkins <marc.tompkins at gmail.com> wrote:
> On Wed, May 15, 2013 at 1:02 PM, Alan Gauld <alan.gauld at 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


Oscar


More information about the Tutor mailing list