When playing with decorators (this week’s challenge) I got stuck: how do you write a decorator that takes an optional argument? Python cookbook 3rd ed edition to the rescue. In this post how I failed my way to the right solution.
Articles on Tips
Best Practices for Compatible Python 2 and 3 Code
By Bob Belderbos on 22 March 2017
95% of most popular Python packages support Python 3. Maybe you are lucky and get to start fresh using Python 3. However as of last year Python 2.7 still reigns supreme in pip installs and at a lot of places 2.x is the only version you get to work in. I think writing Python 2 and 3 compatible code is an important skill, so lets check what it entails.
10 Tips to Get More out of Your Regexes
By Bob Belderbos on 15 March 2017
Regular expressions can be arcane, yet when used with care they can also be very powerful. In this post a couple of tips to get more out of your regexes when using Python’s re module.
How to Order Dict Output in Python
By Julian Sequeira on 16 February 2017
Learn how to order the output of a Python Dict
