On Fri, Sep 22, 2017 at 1:59 AM, Rhodri James <rho...@kynesim.co.uk> wrote:
> On 21/09/17 16:12, Steve D'Aprano wrote:
>>
>> On Thu, 21 Sep 2017 08:19 pm, Rhodri James wrote:
>>
>>> (That's basically my gripe against print becoming a function in Python3.
>>>    It makes a lot of sense as has already been pointed out, but it breaks
>>> every beginners tutorial.)
>>
>> Nobody made that decision lightly. It wasn't a spur of the moment
>> decision,
>> Guido didn't wake up one morning and say "Hey, how about we break a whole
>> lot
>> of the Python ecosystem for giggles!" You can't fix mistakes without
>> breaking
>> things that depend on those mistakes.
>
>
> Oh, I don't doubt it, and Python3 is the better for it.  It's just that my
> major use for Python at the time was teaching a summer course for 12-15 year
> olds, and switching to Python3 would have involved rewriting almost every
> worksheet we had.  So we didn't.
>
> (Looking at the worksheet sources on Github, the course still hasn't made
> the switch!)

For a good while, I was in the same position. But instead of massively
rewriting everything, all I did was to adjust the material to use
Py2/Py3 compatible syntax. Adding parens around your print calls won't
stop it from being Py2-compatible, and it means that the shift to Py3
becomes a lot easier. A handful of other minor changes here and there
(using the explicit // operator when floor division was important, or
ensuring that obsolete syntax wasn't used), and the course was solidly
in the 2-3 compatibility range. No cost to Py2 compatibility, and the
work could be done progressively.

Teaching people to put parens around their prints won't hurt them, and
might help them. It wasn't hard for us, because all our course
material is online; if you're working with printed worksheets, you may
end up with two versions going around (which would cause confusion -
"why does this have brackets and that not?"), so it could just be left
until there's edits being made for other reasons. Still, it can be on
the list of "if you're making changes, do this", like fixing typos or
spelling errors.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to