I am communicating with some hardware over an I2C bus. Every so often, there is an exception as the bus is busy so I am currently handling this with a loop that retries, but there’s a lot of code repetition, I want to tidy it up. So, I tried to write a decorator function to pass various functions to As an example, this command initialises the bus: i2c = busio.I2C(board.SCL, board.SDA) This is the decorator I have written: And then I try to pass it the line mentioned above as a partial: i2c = try_decorator(partial(busio.I2C, board.SCL, board.SDA), ‘i2c init’) but