Is An Element of a Sequence an Object?

Peter Otten __peter__ at web.de
Mon Jun 5 04:30:01 EDT 2017


Jussi Piitulainen wrote:

> Peter Otten writes:

>> However, this is an implementation detail:
>>
>>>>> def is_cached(c):
>> ...     return c[0] is c[0][0]
>> ...
> 
> I think this works the same, and looks more dramatic to me:
> 
> ...    return c[0] is c[0]

Indeed. That's how I would have written it had I understood completely the 
point I was trying to make ;)





More information about the Python-list mailing list