On 2021-09-01 10:28, Nick Parlante wrote:
Now for Python, == vs. is nothing like that bad. Both == and is are
sensible, necessary parts of the language, I would just prefer to talk
about == earlier and is later. Of the two, == is the no-brainer one when
the students just have ints and strings, and no-brainer is what you want
in week 2.
Then go ahead and do that! :-)
No one and nothing is stopping you from teaching your class in any
manner you choose. It's just that you seem to have chosen a particular
combination of IDE features, teaching schedule, and pedagogical
desiderata that has painted you into a corner where you cannot tell the
students what you want to tell them when you want to tell it to them
without their IDE giving them some kind of warning. I just don't see
how any of that is a Python problem at all.
There is nothing wrong, in my view, with a teaching approach that tells
people to do a thing one way and then later tells them to move on to a
different way. When you learn subtraction in first or second grade,
they tell you that if you see something like 2 - 5, you "can't do that"
because you "can't" take a bigger number away from a smaller one. Then
later they tell you that actually you can, you just get a negative
number. Similarly, I don't see any problem with telling your students
about ==, using == None, and then later telling them that actually
there's a better way. Or you can tell them from the beginning to always
write `is None` instead of `== None`, without explaing why, but just
tell them to bear with you because you'll explain the reasoning later.
> For teaching, you are not just identifying the 500 important things they
> need to know. To teach artfully, you are trying to think of an ordering,
> layering on 50 new things each week, where the subest achieved each week
> is internally coherent and you can do a project just using that subset,
> and at the end of the course you've gotten through everything.
That's right, but the key word is "trying". You won't always achieve
100% internal consistency at every moment in the class --- and that's fine!
More importantly, those decisions are wholly decisions to be made be
the teacher. These are issues about how to teach Python, not about what
Python actually is. The fact that `is` and `==` are two different
comparison operators is part of how Python works. There isn't any
solution here that involves eliminating that difference. It's your
choice as a teacher how to handle it, but I just don't see how Python
(or PEP 8) needs to change here.
As someone who has taught Python a bit, I'd say if `== None` vs `is
None` is a major issue for you, your class is probably pretty awesome
already, because that's a pretty minor issue! As long as, by the end of
the class, you wind up conveying the essential concepts about equality,
identity, and how to use them, I think you'll have succeeded. If there
was a moment or a day or even a week in the middle where some people
erroneously thought they should use `== None`, that doesn't really
matter as long as they learn to use `is None` by the end of the course.
Isn't that enough?
--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no
path, and leave a trail."
--author unknown
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/TLS6DFMALW24HGAUEKI4UHRBCHCEITRJ/
Code of Conduct: http://python.org/psf/codeofconduct/