Category Archives: python

Immutable Objects In Python

Immutable objects are useful for making sure the data they contain cannot be changed after they are created. Immutable objects can be useful for passing messages between components, and when working with multiple threads. Immutable objects can also be easier to work with and reason about, because once they are created they cannot be changed.… Read More »

Python BDD

Behaviour Driven Development, or BDD, is a valuable collaboration technique for bridging the gap between developers and wider stakeholders. One part of BDD is the tools or frameworks that can be used to convert BDD statements into actual running tests. This post goes through a simple example using the pytest-bdd plugin. Python BDD with pytest-bdd… Read More »

Python Variable Function Arguments

Python variable function arguments are typically represented by the somewhat arcane-looking ‘*args’ and ‘**kwargs’ arguments in a function signature. Using python variable function arguments frees you from having to know in advance exactly how many arguments a function or method will take, which can be very useful. Variable Function Arguments There are two ways we… Read More »