luminousmen
I P
Back

Best blogs/podcasts to follow for Python developers

I want to share blogs and podcasts I occasionally read/hear stuff from. Python subreddit First things first. This is a good feed for any Python related news. Dev.to This is a great source of information for beginners and I really love the community around this resource. Ned Batchelder blog This is the personal blog of well known in Python community Ned Batchelder. Nikita Sobolev blog Nikita...

Asynchronous programming. Python3.5+

This is a practical post of the series of asynchronous programming. Whole series: Asynchronous programming. Blocking I/O and non-blocking I/O Asynchronous programming. Cooperative multitasking Asynchronous programming. Await the Future Asynchronous programming. Python3.5+ In this post we will be talking about the Python stack on the concepts we talked so far: from the simplest like threads,...

__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')...

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...

Optional arguments MUST use keywords (Python3)

Imagine that you are developing software for the big shipping company(why would you imagine small anyway). And you got a task to create a function for calculating a charge for ships based on their cargo weight. Easy breezy: WEIGHT_RATES = [ ( 10, 10.55), ( 5, 5.05), ( 2, 3.35), ( 0, 1.25) ] def shipping_charge(weight): if weight < 0: raise ValueError("Can't calculate shipping charge of...

Python interview questions. Part III. Senior

We all know that senior is not just a technical role that bound with years of experience and knowledge about his tools, they also have mentoring skills, some management skills in order to measure tasks and their time, and they tend to have some architecture skills etc. My questions here is only for technical side of Python senior developers. Questions Q: When will the else part of...