In Qt you can connect any signal with any slot. This also means you can connect a single signal with several slots or several signals with a single slot.
Now if every button does a different thing and there aren't that many I would connect each one manually with a different slot just to have things nicely separated.
In your case you probably want to connect all the buttons with a single slot in an automatic fashion and in this slot determine the button of origin by self.sender()
and then do something with this information.
Example:
Whenever a new button occurs in your widget
new_button.clicked.connect(self.parent().buttons_clicked)
# always the same recipient
And in the parent class:
def buttons_clicked(self):
button = self.sender()
# do something useful depending on the button that sent the signal
What is missing here is the way you transfer your attribute (the number or whatever). You didn't specify how you do it now but it should probably not be altered significantly by connecting to the same slot.
edit: As a sidenote, there are also events in Qt which roughly do the same. Signals/slots vs events is an interesting discussion. Depending on your problem (many dynamic buttons) instead of connecting and disconnecting you might be better off with sending events.