H is for Harre.

harre.dev

Tdd

Testing Python code that runs during import

I’ve been pretty comfortable with Python after making the switch from dotnet core to Python for a new client.

During this time I’ve gotten to know the way around the ecosystem and Python-isms, but sometimes I run into something that makes me go “huh? oh…”. This post describes one such moment.

Modules

So in Python modules can use each others functionality by importing them into one another using the import keyword and referencing the module you want to use e.g: