Ruby, unlike Python, makes lots of things implicit, and there’s a special kind of if expression that demonstrates this well. It’s often referred to as an “inline-if” or “conditional modifier”, and this special syntax is able to return one value when a con… Read more
Similar
Welcome to the second edition of “Station Wagon Full of Tapes”. This is a deep dive into how we can achieve structural subtyping in Python using Protocol definitions from. In this post there will be excerpts from code attached as images, so make sure the ... (more…)
Read more »
Laziness is a virtue - well, in programming anyway! Professor Thorsten Altenkirch on how you can use the 'yield' to compute certain things "on demand" To Inf... (more…)
Read more »
Have you ever wanted to get your hands on a CSV file with the historical bitcoin OHLC1 prices over the past year, and use it as a training set for your machine learning algorithms? Open/High/Low/Close, for more information look at this post. ↩... (more…)
Read more »
The conflict between subclassing and composition is as old as object-oriented programming. The latest crop of languages like Go or Rust prove that you don’t need subclassing to successfully write code. But what’s a pragmatic approach to subclassing in Pyt... (more…)
Read more »
If your Python programs are slower than you’d like you can often speed them up by parallelizing them. In this short primer you’ll learn the basics of parallel processing in Python 2 and 3.
(more…)
Read more »