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

Fuzzyman fuzzyman at gmail.com
Wed Jan 18 11:53:13 EST 2006


Fredrik Lundh wrote:
> 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)
>
> the "value" of a C array is the address of its first argument.  two separate
> arrays will never compare equal, no matter what they contain.
>
> (C programs tend to use various "cmp" functions to compare stuff; it's up
> to the programmer to keep track of how to compare things...)
> 

Thanks.

Fuzzy

> </F>




More information about the Python-list mailing list