simultaneous assignment

John Salerno johnjsal at NOSPAMgmail.com
Tue May 2 13:35:36 EDT 2006


Diez B. Roggisch wrote:

> Then use a Proposition-class that holds the actual value.
>  
>> Another thing I'm trying to do is write a function that tests to see if
>> a list contains exactly one true item, and the rest are false (obviously
>> this would have to be a list of boolean values, I guess).
> 
> No - you can for example override the comparison-semantics on the
> Proposition-class to be comparable with True/False with the proper
> semantics:

Hmm, classes still scare me a little, but I should consider this. The 
only thing is, it is not known in advance if the propositions are true 
or false, you have to figure that out yourself based on the combination 
of the statements given. I don't know if this changes the idea behind 
your Proposition class...I'll have to give it some more thought.



More information about the Python-list mailing list