New submission from Javier Dehesa :
This comes from this SO question: https://stackoverflow.com/q/52382983/1782792
Currently, this works:
> print({1, 2} in {frozenset({1, 2}))
# True
This is strange because set is unhashable. Apparently, it is a case-specific
feature implemented b
Javier Dehesa added the comment:
Thanks Christian. I thought of join precisely because it performs conceptually
the same function as with str, so the parallel between ''.join(), [].join() and
().join() looked more obvious. Also there is os.path.join and
PurePath.joinpath, so the v
New submission from Javier Dehesa :
It is pretty trivial to concatenate a sequence of strings:
''.join([str1, str2, ...])
Concatenating a sequence of lists is for some reason significantly more
convoluted. Some current options include:
sum([lst1, lst2, ...], [])
[x f
Javier Dehesa added the comment:
With the additional hint of garbage collection I have found now a number of
examples of this behaviour (e.g.
https://stackoverflow.com/questions/7439432/python-themed-tkinter-entry-variable-will-not-set).
However, I haven't found actual documentation warni
Javier Dehesa added the comment:
I see what you mean. Looking at TkDocs (not sure if this is an "official" or
"officially endorsed" source or not), one of the Python examples in the "Tk
Concepts" section (http://www.tkdocs.com/tutorial/concepts.html) says:
> W
Javier Dehesa added the comment:
Yeah is quite subtle, I should have pointed it out...
The difference is that `root.mainloop()` is called inside `make_var_cb(root)`
in the first example and under `if __name__ == '__main__'` in the second one. I
have experience the problem on Windo
Javier Dehesa added the comment:
Note, this is not something specific to check buttons, the same happens with
other widgets such as entries.
--
___
Python tracker
<http://bugs.python.org/issue30
New submission from Javier Dehesa:
When you build a Tkinter interface with variables, if tkinter.Tk.mainloop is
called from a different function that the one creating the variable objects,
then in some cases the widgets associated with the variables will not be set to
the right value. I have