introducing python
When I start introducing Python I use this chart [1]: Five Dimensions of Python: - Level 0: core syntax with keywords & punctuation, indentation (import, if...) - Level 1: a large set of built-ins (e.g. print) - Level 2: special names with the double underlines - Level 3: Standard Library (e.g. math) - Level 4: 3rd Party Ecosystem (e.g. numpy, pandas, matplotlib) Here's a Level 2 topic I've been recently working on: https://nbviewer.org/github/4dsolutions/m4w/blob/main/gadzooks.ipynb I know, we don't all love those __ribs__ (special names), however that's a benefit of Free Open Source: you can fork and adapt, take the best ideas, and leave the rest. This one is about how implementing __add__ gets you default behavior for __iadd__ with no extra work, with the option to go on to add your own __iadd__. Kirby [1] example of me doing that: https://github.com/4dsolutions/clarusway_data_analysis/blob/main/python_warm... coming from: https://nbviewer.org/github/4dsolutions/clarusway_data_analysis/blob/main/DA... (Exhibit: some Python teaching in the wild....)
participants (1)
-
kirby urner