Blog | luminousmen

Back

Resolve cython and numpy dependencies on setup step

In my project, I have a custom Python package that has part of its functionality implemented on Cython. We use it to accelerate some of the slowest parts of our code — the syntax is pretty close to regular Python (it can be absolutely identical except for some imports). Cython compiled with .so...

Optional arguments MUST use keywords (Python3)

Imagine that you are developing software for a large shipping company (why not imagine a small company). And you have the task of creating a function for calculating fees for ships based on their cargo weight. Easy peasy: WEIGHT_RATES = [ ( 10, 10.55), ( 5, 5.05), ( 2, 3.35), ( 0, 1.25) ] def...