On Sun, 03 Jun 2018 10:55:04 +0800, Jach Fong wrote: > The attached is a script which can run under Python 3.4/Windows Vista > correctly. One thing make me puzzled is that the "any + context" at line > 18. The "any" was passed as an integer from line 43 and the "context" > was defined as a tuple at line 35. This concatenation works! how?
90% of the script you attached is irrelevant to your question. None of the tkinter or threading code is important. The only important parts are: def threaded(action, args, context, onExit, onProgress): def progress(*any): threadQueue.put((onProgress, any + context)) Here we can tell that ``any`` is a tuple. But what is context? Following it backwards, we find: context = (myname,), which is not an int, but a tuple. Try it for yourself: py> value = ("Steven",), py> print(value) (('Steven',),) -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson -- https://mail.python.org/mailman/listinfo/python-list