luminousmen
I P

Asynchronous programming. Blocking I/O and non-blocking I/O

This is the first post of a series about asynchronous programming. The whole series tries to answer the simple question: "What is asynchrony?". At first, when I just started digging into the question - I thought that I know what it is. It turned out that I didn't know a clue about what asynchrony is all about. So, let's find out! Whole series: Asynchronous programming. Blocking I/O and...

Concurrency and parallelism are two different things

It may seem that there is no difference between concurrency and parallelism, but this is because you did not understand the essence of the matter. Let's try to understand how they differ. Concurrency is the execution of more than one task is being processed at the same time inside the application. An important detail is that tasks are not necessarily performed at the same time(but it's...

__context__ vs __cause__ attributes in exception handling

Since Python 3.0, raising an exception in an except block will automatically add the caught exception in the __context__ attribute of the new one. That will cause both exceptions to be printed. Essentially this is a way for the current exception to carry information about the previous exception. For example: try: raise ValueError('ValueError') except ValueError: raise TypeError('TypeError')...

What is the definition of a good software engineer?

"What is the definition of a good software engineer" - I like to ask this question everybody who somehow connects to software development. And I always got different answer. It depends on the people and their positions: managers see good software engineers to have a good understanding of the tasks, respect deadlines and soft skills. Middle/Senior software engineers always start with the words...

Ode to Unit Tests

The Law of Testing: The degree to which you know how your software behaves is the degree to which you have accurately tested it. -- "Code Simplicity" In order to verify the correctness of an application we use different kinds of tests: some check the logic of a small function or class, others check all the system layers from UI to databases and external services. Some kinds of tests could be...

Resolve cython and numpy dependencies on setup step

I have a custom Python package on my project where some functionality implemented on Cython. We use it to speed up some of the slowest parts of our code - the syntax is pretty close (it can be identical except some imports) to regular Python. Cython compiled to .so libraries and it has support for fast access to NumPy arrays. The problem - Cython and numpy packages need to be installed before...