This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alexandre.vassalotti
Recipients alexandre.vassalotti, brett.cannon, christian.heimes, gvanrossum
Date 2007-10-26.00:19:28
SpamBayes Score 0.0031678115
Marked as misclassified No
Message-id <1193357969.06.0.923641373901.issue1302@psf.upfronthosting.co.za>
In-reply-to
Content
> I still don't understand why you are using (sizeof lower) - 2 

It is simply to avoid duplicating the constant (a.k.a. the Don't Repeat
Yourself (DRY) rule).

> and what &lower[(sizeof lower) - 2] returns. Is it the memory address
> of lower[17]?

It the address of lower[18] to be exact. (l < &lower[(sizeof lower) -
2]) is simply tricky notation to check the bound of the array.
Personally, I used like to subtract pointer, ((lower - l + 1) < (sizeof
lower)) to get the bound. But now, I find Guido's trick more cute (and
less error-prone). :)
History
Date User Action Args
2007-10-26 00:19:29alexandre.vassalottisetspambayes_score: 0.00316781 -> 0.0031678115
recipients: + alexandre.vassalotti, gvanrossum, brett.cannon, christian.heimes
2007-10-26 00:19:29alexandre.vassalottisetspambayes_score: 0.00316781 -> 0.00316781
messageid: <1193357969.06.0.923641373901.issue1302@psf.upfronthosting.co.za>
2007-10-26 00:19:29alexandre.vassalottilinkissue1302 messages
2007-10-26 00:19:28alexandre.vassalotticreate