Listbox fill=BOTH expand=YES (Tkinter)

Christos TZOTZIOY Georgiou tzot at
Thu Mar 17 11:06:30 CET 2005

On Thu, 17 Mar 2005 00:54:46 +0300, rumours say that "Raseliarison nirinA"
<nirina at> might have written:

>i'll recite 42 times precedence rules before going to bed.
>but now i'm a bit confused by the -in- operator. as:
>    >>> set(['TRUE','YES']).issubset(set(dir(Tkconstants)))
>    True

>i expected this to be true, but it's not:
>    >>> set(['TRUE','YES']) in set(dir(Tkconstants))
>    False

the 'in' operator searches for existance of *elements* in a set, not of
*subsets*.  BTW, only a frozenset can be included in a set.

To check for subsets, either use the issubset function, or the '<' operator (I
believe they both call the same code):

.>> set(['TRUE','YES']).issubset(set(dir(Tkconstants)))

can be expressed as

.>> set(['TRUE','YES']) < set(dir(Tkconstants))
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...

More information about the Python-list mailing list