Re: check for dictionary keys

2006-06-06 Thread John Machin
On 6/06/2006 8:38 PM, bruno at modulix wrote: > John Machin wrote: >> On 5/06/2006 10:46 PM, Bruno Desthuilliers wrote: >> >>> [EMAIL PROTECTED] a écrit : >>> hi in my code, i use dict(a) to make to "a" into a dictionary , "a" comes from user input, so my program does not know in the

Re: check for dictionary keys

2006-06-06 Thread bruno at modulix
John Machin wrote: > On 5/06/2006 10:46 PM, Bruno Desthuilliers wrote: > >> [EMAIL PROTECTED] a écrit : >> >>> hi >>> in my code, i use dict(a) to make to "a" into a dictionary , "a" comes >>> from user input, so my program does not know in the first place. Then >>> say , it becomes >>> >>> a = {

Re: check for dictionary keys

2006-06-05 Thread John Machin
On 5/06/2006 10:46 PM, Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : >> hi >> in my code, i use dict(a) to make to "a" into a dictionary , "a" comes >> from user input, so my program does not know in the first place. Then >> say , it becomes >> >> a = { '-A' : 'value1' , '-B' : "value2"

Re: check for dictionary keys

2006-06-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > hi > in my code, i use dict(a) to make to "a" into a dictionary , "a" comes > from user input, so my program does not know in the first place. Then > say , it becomes > > a = { '-A' : 'value1' , '-B' : "value2" , "-C" : "value3" , '-D' : > 'value4' } > > somewhere ne

Re: check for dictionary keys

2006-06-02 Thread faulkner
def all(s): for x in s: if not x: return False return True bad_combos = [['-A', '-B'], ['-A', '-C'], ...] for bad_combo in bad_combos: assert not all([bad_elem in a for bad_elem in bad_combo]) [EMAIL PROTECTED] wrote: > hi > in my code, i use dict(a) to make to "a" into a dic

check for dictionary keys

2006-06-02 Thread micklee74
hi in my code, i use dict(a) to make to "a" into a dictionary , "a" comes from user input, so my program does not know in the first place. Then say , it becomes a = { '-A' : 'value1' , '-B' : "value2" , "-C" : "value3" , '-D' : 'value4' } somewhere next in my code, i will check for these..: 1)