Hi there folks. In this post I would be sharing a couple of command-line tools which can help to increase your python productivity. These tools have helped me a lot and might help you as well! This post is inspired by another post. Continue reading
Originally posted on Wrong Side of Memphis:
This blog post by Dan Crosta is interesting. It talks about how is possible to optimise Python code for operations that get called multiple times avoiding the usage of Object Orientation and using Closures instead.
While the “closures” gets the highlight, the main idea is a little more general. Avoid repeating code that is not necessary for the operation.
The difference between the first proposed code, in OOP way
and the last one
The main differences are that both the config dictionary and the methods (which are also implemented as a dictionary) are not accessed. We create a direct reference to the value (categories and mode) instead of making the Python interpreter search on the self methods over and over.
This generates a significant increase in performance, as described on the post (around 20%).
But why stop there? There is another clear win in terms of access, assuming that the…
View original 310 more words
Hi there guys! If you have been following my recent posts then you might know that I have started a newsletter. This newsletter covers everything related to Python which I come across every week. Continue reading
Hi there guys! You might already be acquainted with tuples. A tuple is a lightweight object type which allows to store a sequence of immutable Python objects. They are just like lists but have a few key differences. The major one is that unlike lists, you can not change a value in a tuple. In order to access the value in a tuple you use integer indexes like: Continue reading
Hi there folks. I am writing a book on Python tips, tricks and patterns. This will be a short book of nearly 100 pages. I have already written about 56 pages. I would be self-publishing it in July or August. I am pretty sure that you would love this book. Here is an unsorted list of content which I have already written about: Continue reading
Hi there folks. It’s been a long time since I last published a post. I have been busy. However in this post I am going to share some really informative tips and tricks which you might not have known about. So without wasting any time lets get straight to them: Continue reading
Hi folks. In this post I am going to share some great articles which I recently got across. Apart from that I would also be sharing some news relating to Python. Continue reading