Noob to micropython interrupt handlers

I have been trying to get this code to work

import pyb
import utime

import micropython

# Global constants
buttonPressedTime = 200    # milliseconds

# Ring buffer implementation
ringTail = 0
ringHead = 0
ringSize = 20
ringFull = False
msRingBuffer = None
trRingBuffer = None

# Global variables
buttonPin = None
extInt = None

# button pressed flag
buttonPressed = 0
greenLedOn = 0

# button transition ISR
def buttonTransitionISR():
    global buttonPin
    global trRingBuffer
    global msRingBuffer
    global ringHead
    global ringFull

    if ringFull == False:
        trRingBuffer[ringHead] = buttonPin.value()
        msRingBuffer[ringHead] = utime.ticks_ms()
        localRingHead = (ringHead + 1) % ringSize
        if localRingHead == ringTail:
            ringFull = True
            ringHead = localRingHead
    # else: do nothing

def initialiseInterrupts():
    global buttonPin
    global buttonClock
    global extInt
    global trRingBuffer
    global msRingBuffer
    global buttonPressed

    # Initialise ring buffer
    trRingBuffer = bytearray(ringSize)
    msRingBuffer = bytearray()
    # Have to do this as we do not know what utime.ticks_ms() returns
    for index in range(0,ringSize):

    # experimental button pin
    buttonPin = pyb.Pin('P0', pyb.Pin.IN)

    # set up ISR for button press
    extInt = pyb.ExtInt(buttonPin, pyb.ExtInt.IRQ_RISING_FALLING, pyb.Pin.PULL_UP, buttonTransitionISR)

# check for button pressed condition
def buttonPressedCheck():

# Initialise interrupt handlers

# use these LEDs for experiments
display_led = pyb.LED(1)
green_led = pyb.LED(2)
blue_led = pyb.LED(3)
red_led = pyb.LED(4)

# start with LED off

    if buttonPressed == 1:
        if greenLedOn == 0:
            print("green led ON")
            greenLedOn = 1
            greenLedOn = 0
            print("green led OFF")

But when I run it on an M7 with firmware V3.1.0 and ground P0 I get the error

Uncaught exception in ExtInt interrupt handler line 15
TypeError: function takes 0 positional arguments but 1 were given

I was expecting it to run with multiple P0 grounding’s and eventually get a ringFull = True.
What am I doing wrong?

Okay. To answer my own question. The function buttonTransitionISR is missing the line parameter.

Yeah, that’s this weird parameter that isn’t particularly useful but has to be passed in.