A practical guide on how to manage a collection of code snippets as a single, easy to maintain library collection. I will utilise Python package namespacing, managed in a Git mono-repository.
(more…)Uncategorized
jsonchema: Custom type, format and validator in Python
jsonschema
Typing support in Python
Python type checking: Assertions, exceptions, Mypy
The second article in series about typing support in Python will show you how to take type hints a step further and enforce type checking. Both Python 2 and 3 will be covered. You will also see why you may need a type support in the first place.
(more…)Uncategorized
Waiting on multiple Event objects in Python 3
Passive waiting is a way of suspending programs execution without consuming any CPU (in contrast with active waiting where a program is busy doing nothing). In Python, you can use certain classes from the threading module (such as Condition and Event). Let’s take for example the Event class. It is good for waiting for an event. But what if you need to wait for many events? You might say „Why not to make a list of multiple Event objects and wait for all of them?” Well… that is not going to work:
(more…)