Can a simple a==b 'hang' in and endless loop?

Fuzzyman fuzzyman at gmail.com
Wed Jan 18 11:32:37 EST 2006


Fuzzyman wrote:
> I'm not familiar with the C basic datatypes - I assume it has an array
> or list like object.
>
> Would it contain a sequence of poitners to the members ? In which case
> they would only be equal if the pointers are the same.
>
> In this case :
>
> a = ['some string']
> b = ['somestring']
> a == b
> False (probably)
>

Oops... definitely False unless it is corrected to :

a = ['some string']
b = ['some string']
a == b
False (probably)

All the best,


Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

> Incorrectly using Python syntax for a C example of course :-)
>
> All the best,
> 
> Fuzzyman
> http://www.voidspace.org.uk/python/index.shtml




More information about the Python-list mailing list