This will be the best advented code ever! Trying to use test driven development and typed python.
Code auto-formatted with black
set()
s are awesome to get unique elements from a listset()
s also allow you to find intersections and overlaps- need to tell VS Code to use
setup.cfg
for activated linters (see.vscode/settings.json
)
- TDD on top level is always worth it
- adding tests for smaller steps creates very modular code..maybe too many functions, seem to lack cohesion because all functions are only used one time
- beware of edge cases (day8: extreme values sitting on the edge of the map)
- just because you think that two implementations do the same thing, does not mean they do (test them both)
- using
dict()
orlist()
for instantiation is slower than using the literals{}
,[]
- using
typing.Dict/List
was necessary pre Python 3.10 but nowdict/list/tuple[]
are preferred solutions without additional imports - a customized solution may be a lot faster than a generic one (day12)