Hacker News new | ask | show | jobs
by webartifex 2274 days ago
I introduce the idea of a type right in chapter 1 because of exactly the argument you make.

As Python is really more about the behavior of objects and not so much their type, I introduce these already from chapter 4 onward, for example, iterable vs. container, and many more. I actually would say that this is the essence of any dynamic language (duck typing).

"and how to read the python documentation" -> that is an important point you raise!!! I found that beginners have real trouble reading the docs because they are screening for words like "list" instead of "iterable". However, as I teach abstract behaviors early, they actually understand the docs.

"like using .format() instead of fStrings" -> I mention .format() but mainly use f-strings and tell the students right away that they are both faster and easier to read and that they should default to them.