In today’s article 10 tips to improve the quality of your Python functions.
Articles on Tips
Python in Everyday Life
By Jesse Brink on 28 December 2020
In this article Jesse shares how he used Python to leverage his daughter’s homework assignment …
10 Things We Picked Up From Code Reviewing
By Bob Belderbos on 24 September 2020
Here are some things we picked up from code reviews that when addressed can make your code a lot cleaner.
There is More Than One Way to Solve a Bite Exercise
By Harrison Morgan on 21 August 2020
According to the Zen of Python, “There should be one– and preferably only one –obvious way to do it.” It’s a good principle for designing a program: the more ways there are of doing something, the more confusing the software becomes, along with a host of other problems. In reality, though, there almost always is more than one way to accomplish something. The quotation even displays this fact: it places the dash in two different ways, neither of which are the obvious way.
Refactoring Opportunities That Will Boost the Quality of Your Code
By Bob Belderbos on 19 April 2020
Refactoring is all about making your code more maintainable. In this article I will provide you with Python and generic software tips to write better code.
There’s no Wrong Way… to Eat a Bite of Py
By AJ Kerrigan on 27 November 2019
There are many ways to tackle a Bites of Py exercise, try them all!
Using Python Requests on a Page Behind a Login
By Julian Sequeira on 9 June 2017
In this post I discuss using the requests module on web pages behind a login
How to Write a Decorator with an Optional Argument?
By Bob Belderbos on 11 April 2017
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.
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.