<div dir="ltr">Thanks, I'll check it out. <br><div><br></div><div>I just made a local function "connectButton" and that does the trick.  But I like the default lambda parameter for more conciseness.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 17, 2019 at 1:06 AM Florian Bruhin <<a href="mailto:me@the-compiler.org">me@the-compiler.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
another possibility is using functools.partial instead:<br>
<br>
    button.clicked.connect(functools.partial(self.show_color_dialog, color))<br>
<br>
IMHO, this is a nice explanation of the issue and possible solutions:<br>
<a href="https://docs.python-guide.org/writing/gotchas/#late-binding-closures" rel="noreferrer" target="_blank">https://docs.python-guide.org/writing/gotchas/#late-binding-closures</a><br>
<br>
Florian<br>
<br>
-- <br>
<a href="https://www.qutebrowser.org" rel="noreferrer" target="_blank">https://www.qutebrowser.org</a> | <a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a> (Mail/XMPP)<br>
   GPG: 916E B0C8 FD55 A072 | <a href="https://the-compiler.org/pubkey.asc" rel="noreferrer" target="_blank">https://the-compiler.org/pubkey.asc</a><br>
         I love long mails! | <a href="https://email.is-not-s.ms/" rel="noreferrer" target="_blank">https://email.is-not-s.ms/</a><br>
</blockquote></div>