|
|
|
|
|
by carapace
1476 days ago
|
|
Thanks for posting that, I was puzzled too. - - - - I can't help myself. The example in the PEP: buttons = [QPushButton(f'Button {i}') for i in range(10)]
# Do stuff with the list of buttons...
@buttons[0].clicked.connect
def spam():
...
...
seems silly to me, I would have done something like: connect_button = lambda n: buttons[n].clicked.connect
@connect_button(0)
def spam():
...
I was a huge Python fan but these days I really feel that Python is being improved to death. |
|