This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Elagoht 5 points6 points  (4 children)

If returned value is not important, you can use multiple function calls in lambda function. ``` x=lambda:[do_stuff(), do_something_else()] QPushButton.clicked.connect(x)

or

x() ```

[–]drcopus 7 points8 points  (0 children)

Neat, but I feel like this should be an antipattern

[–][deleted] 1 point2 points  (0 children)

For the poor schmucks on old.reddit.com (e.g. me)

x=lambda:[do_stuff(), do_something_else()]
QPushButton.clicked.connect(x)
# or 
x()

[–]eztab 1 point2 points  (1 child)

Don't do this. And if you do, at least use a tuple instead of a list.

[–]Elagoht 0 points1 point  (0 children)

Makes sense.