.. include:: Python Advanced (2022-03-15 - 2022-03-17, 2022-03-31) ===================================================== .. sidebar:: *Training Information* * :doc:`/trainings/material/soup/python/advanced/group` * :doc:`/trainings/material/soup/python/group` * Jupyter Notebook * :doc:`Structure ` * :doc:`Entire Notebook ` * :download:`download ` * `Github Repository `__ * Predecessor training: :doc:`../2022-02-23/index` .. toctree:: :hidden: Jupyter Notebook (Übersicht) Jupyter Notebook .. contents:: :local: 2022-03-15 ---------- * :doc:`/trainings/material/soup/python/exercises/legacy/primeness_function` * :doc:`/trainings/material/soup/python/exercises/legacy/distill` * :doc:`/trainings/material/soup/python/misc/encoding/topic` 2022-03-16 ---------- Good morning! * Live-hack ``eval()`` * :doc:`notebook (first) ` * `dict-from-cmdline.py `__ * :doc:`/trainings/material/soup/python/advanced/exec/topic` (`exec-context.py `__) * :doc:`/trainings/material/soup/python/advanced/starargs/topic` (`args-kwargs.py `__) * :doc:`/trainings/material/soup/python/advanced/closures/topic` (`closure.py `__) * :doc:`/trainings/material/soup/python/advanced/decorators/topic` (`decorator.py `__) Continue with exercises: CSV |longrightarrow| modularization * :doc:`/trainings/material/soup/python/misc/csv/topic` * :doc:`/trainings/material/soup/python/exercises/userdb/csvreader` * :doc:`/trainings/material/soup/python/exercises/userdb/csvdictreader` Test Driven Development ....................... (Mostly from :doc:`/trainings/material/soup/clean-code/group`) I had stated my strong opinion about (excess) debugger usage. (In short words, debuggers are from hell when you use one to *comprehend* code that is otherwise incomprehensible - the same holds true for excess IDE usage). Discussion, naturally (thank you Alex). Decided to switch to test driven development, provocantly. Based upon :doc:`/trainings/material/soup/python/swdev/pytest/intro`, hacked the following topics while introducing TDD: * :doc:`/trainings/material/soup/python/exercises/userdb/csvdictreader-function` * :doc:`/trainings/material/soup/python/advanced/modules` * :doc:`/trainings/material/soup/python/exercises/userdb/userdb_csv` ("Project" `here `__) 2022-03-17 ---------- Revisit yesterday's mess ... * Show ``userdb`` "project" on `Github `__ Plan for exercises: test driven * :doc:`Manager ` writes test (and commits/pushes to Github) * Team mates `download ZIP file `__ (also done via the `"Code" button on project's main page `__) * Team mates hack * :doc:`/trainings/material/soup/python/swdev/pip/topic` * :doc:`/trainings/material/soup/python/swdev/venv/topic` * :doc:`/trainings/material/soup/python/swdev/pytest/intro` Continue with mess ... * Elaborate on ``class User`` |longrightarrow| require that constructor raise a dedicated exception if, for example, ``id`` is not an integer (requirement `here `__) * More requirements ... (`here `__) * More ... * ``User`` "invalid ID" exception * "Duplicate ID in DB" exception * Common exception base class * ``collections.defaultdict`` * :doc:`/trainings/material/soup/python/misc/db/group` * `sqlite3 user database test `__ * `CSV to database program `__ 2022-03-31 ---------- * :doc:`/trainings/material/soup/python/swdev/pip/topic` * :doc:`/trainings/material/soup/python/swdev/venv/topic` Links ----- * `Raymond Hettinger - Super considered super! - PyCon 2015 `__. **Raymond Hettinger**, revolving around ``super()`` and MRO. .. raw:: html * `Transforming Code into Beautiful, Idiomatic Python `__. **Raymond Hettinger**, reiterating his favorite phrase: "There must be a better way". (Hettinger is a "Python Core Developer".) (He uses Python 2 though.) .. raw:: html * `Raymond Hettinger, Keynote on Concurrency, PyBay 2017 `__: **Raymond Hettinger** covering most if not all aspects and possiblities of concurrency. Very informative, very concise, covering * Multithreading * Multiprocessing * Async; I didn't even mention that. `asyncio `__. Me big fan. .. raw:: html * `Python Tutorial: pip - An in-depth look at the package management system `__, by `Corey Schafer `__ .. raw:: html * `Python Tutorial: VENV (Windows) - How to Use Virtual Environments with the Built-In venv Module `__: `Corey Schafer `__ again. :doc:`Virtual environments ` are kind of an isolated development sandbox, solving a similar problem as containers do, but much more lightweight and Python only. .. raw:: html * `Python Tutorial: Decorators - Dynamically Alter The Functionality Of Your Functions `__, by `Corey Schafer `__ .. raw:: html