Introduction Python’s versatility in supporting different programming paradigms, including procedural, object-oriented, and functional programming, opens up a rich landscape for software design and development. Among these paradigms, the use of static methods in Python, particularly in an object-oriented context, has been a topic of debate. This article delves into the role and implications of static… Continue reading Exploring the Role of Static Methods in Python: A Functional Perspective
Articles on functions
Using Python in Excel with PyXLL
By PyBites Team on 10 October 2023
In this podcast episode we talk with Tony Roberts, creator of PyXLL (pronounced “pixel”). Listen here: Also released on our YouTube channel: We dive into the backstory of this Python Excel Add-in, why he built it, features, success stories, the business side of things, and also how it compares to Microsoft’s recently announced Python in… Continue reading Using Python in Excel with PyXLL
When to refactor your code?
By Rob van der Leek on 11 August 2023
How to make refactoring part of your Definition of Done Writing code is an iterative process. The first iteration is usually not the best result. Grooming and polishing ✨ are needed before the code is ready to share with the world (and your future self). There is a saying in software development that illustrates the… Continue reading When to refactor your code?
The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
By Bob Belderbos on 9 August 2023
Python allows you to use *args and **kwargs in function definitions to accept an arbitrary number of positional and keyword arguments, respectively. Here is a simple example: Different types of function arguments In the above example, the arbitrary_args function is defined to accept any number of positional and keyword arguments using the *args and **kwargs… Continue reading The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
Django class based vs function based views
By PyBites Team on 28 February 2023
This post first appeared as an email on our friends list. We decided to publish it here because the question is still commonly asked 🤔 The other day I did a presentation on Django class based vs function based views. (Warning: this post is opinionated 😃) Also if you’re not into Django don’t stop reading just yet, because there are… Continue reading Django class based vs function based views
Tips for clean code in Python
By Bob Belderbos on 8 November 2022
In this article I will give you 10 tips for cleaner code. Hope this helps improve your Python code. 1. Smaller units. Break long functions (methods) into multiple smaller ones that do one thing (SRP or “Single-responsibility principle”). This will make your code more modular and easier to test. For example, a function that parses… Continue reading Tips for clean code in Python
10 Tips to Write Better Functions in Python
By Bob Belderbos on 19 January 2022
In today’s article 10 tips to improve the quality of your Python functions.
When to Write Classes in Python And Why it Matters
By Bob Belderbos on 25 April 2020
When people come to Python one of the things they struggle with is OOP (Object Oriented Programming). Not so much the syntax of classes, but more when and when not to use them. If that’s you, read on. In this article I will give you some insights that will get you clarity on this.
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.
Introduction to Python Functions
By Julian Sequeira on 11 February 2020
In this article I’m going to break down what a function is and how you can use them to be a better coder.