Many thanks, everyone. Great answers. I decided to read the manual
properly. May take some time but well worth it.
On Mon, Jul 1, 2013 at 2:40 PM, Steven D'Aprano wrote:
> On 01/07/13 19:58, John Steedman wrote:
>
>> Good morning all,
>>
>> A question that I am unsure about. I THINK I have t
On 01/07/13 19:58, John Steedman wrote:
Good morning all,
A question that I am unsure about. I THINK I have the basics, but I am not
sure and remain curious.
1. What does this mean?
if my_object in my_sequence:
...
Others have already answered this, but for completion, it is testing wheth
On 01/07/13 22:15, Oscar Benjamin wrote:
On 1 July 2013 12:01, Dave Angel wrote:
Third if my_object is something that doesn't equal anything else, such as a
floating point NAN. Two NANs are not equal, and a NAN is not even equal to
itself.
Many builtin collection types do an identity 'is' ch
On Mon, Jul 1, 2013 at 1:01 PM, Dave Angel wrote:
> On 07/01/2013 05:58 AM, John Steedman wrote:
>
>>
>> I believe that "my_sequence" might be a either container class or a
>> sequence type. An effective __hash__ function would be required for each
>> "my_object".
>>
>
> "in" doesn't care if ther
On 07/01/2013 05:58 AM, John Steedman wrote:
Good morning all,
A question that I am unsure about. I THINK I have the basics, but I am not
sure and remain curious.
1. What does this mean?
if my_object in my_sequence:
...
We can be sure what 'if' and 'in' mean, but not the other two items.
Good morning all,
A question that I am unsure about. I THINK I have the basics, but I am not
sure and remain curious.
1. What does this mean?
>>> if my_object in my_sequence:
...
2. What can go wrong with this? What should a code review pick up on?
I believe that "my_sequence" might be a eithe