How to extract the button name in the callback method?

I need the button name for my callback method because the name serves also as a key to a dictionary containing sql commands to be executed on click. I’ve tried to search if the event passed to the callback could have some properties including the name but I have found nothing. Ther must(?) be a way of identifying the button which has been clicked. Could someone help me out with this? The format below works except for the name extraction.

class Query:
    
    def __init__(self):
        self.buttons = [btn_0, btn_1, btn_2]
        self.data = dict

    def callback(self, event):
        
        value = self.dict[button_name]
        # Run an SQL query using the value
        return (the query result)

    def bind_buttons(self):
        
        for button in self.buttons:
            pn.bind(callback, self.button, watch=True)

query = Query()
query.bind_buttons()
query_buttons = pn.Column(
    '# Queries', 
    query.buttons[0],
    query.buttons[1],
    query.buttons[2],
)

This problem can be circumvented by using on_click instead of bind. The on_click-method allows extracting the name from event.obj.name. The following pattern works.

class Query:
    
    def __init__(self):
        self.buttons = [btn_0, btn_1, btn_2]
        self.data = dict

    def callback(self, event):
        
        value = self.dict[event.obj.name]
        # Run an SQL query using the value
        return (the query result)

    def bind_buttons(self):
        
        for button in self.buttons:
            button.on_click(callback)

query = Query()
query.bind_buttons()
query_buttons = pn.Column(
    '# Queries', 
    query.buttons[0],
    query.buttons[1],
    query.buttons[2],
)

The accurate answer to my question was given in Stack Overflow: partial from Python’s functools-module to the rescue.