[Python-Dev] 2.4 vs Windows vs bsddb (original) (raw)
Tim Peters tim.peters at gmail.com
Wed Oct 11 03:20:00 CEST 2006
- Previous message: [Python-Dev] 2.4 vs Windows vs bsddb [correction]
- Next message: [Python-Dev] BUG (urllib2) Authentication request header is broken on long usernames and passwords
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Tim]
Given that, the assert() in question looks fine to me: ... |>> Either that, or the original author (and me, just above) made an error in analyzing what must be true at this point. | [David Hopwood] You omitted to state an assumption that sizeof(errTxt) >= 4, since sizet (and the constant 4) are unsigned. Also bytesleft must initially be nonnegative so that the subexpression 'sizeof(errTxt) - bytesleft' cannot overflow.
I don't care, but that's really the /point/: asserts are valuable precisely because any inference that's not utterly obvious at first glance at best stands a good chance of relying on hidden assumptions. assert() makes key assumptions and key inferences visible, and verifies them in a debug build of Python.
- Previous message: [Python-Dev] 2.4 vs Windows vs bsddb [correction]
- Next message: [Python-Dev] BUG (urllib2) Authentication request header is broken on long usernames and passwords
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]