Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'exception': 0.03; 'column': 0.07; 'option:': 0.09; 'record.': 0.09; 'subject:command': 0.09; 'typed': 0.09; 'cc:addr:python-list': 0.10; 'stored': 0.10; ';-)': 0.11; 'anyway': 0.11; 'index': 0.13; 'boolean': 0.16; 'deleted,': 0.16; 'index;': 0.16; 'pythonic': 0.16; 'received:corp': 0.16; 'tables,': 0.16; 'wrote:': 0.17; 'pointer': 0.17; 'memory': 0.18; 'module': 0.19; 'cc:2**0': 0.23; 'raise': 0.24; 'cc:no real name:2**0': 0.24; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'possibly': 0.27; "doesn't": 0.28; 'decide': 0.28; 'record': 0.28; '(possibly': 0.29; 'attempting': 0.29; 'probably': 0.29; "i'm": 0.29; 'code': 0.31; 'towards': 0.32; 'good.': 0.32; 'certain': 0.33; 'entry': 0.33; 'options:': 0.35; 'pm,': 0.35; 'too.': 0.35; 'next': 0.35; 'visual': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'possible': 0.37; 'does': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'possible.': 0.38; 'think': 0.40; 'your': 0.60; 'most': 0.61; 'remove': 0.61; "you'll": 0.62; 'header:Message-Id:1': 0.62; 'jul': 0.65; 'treat': 0.65; 'believe': 0.69; 'furman': 0.84; 'good!': 0.84; 'seventh': 0.84; 'approach.': 0.91; 'ethan': 0.91; 'subject:records': 0.91 Subject: Re: Foxpro goto command and deleted records Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Ed Leafe In-Reply-To: <5006F0F7.8030004@stoneleaf.us> Date: Wed, 18 Jul 2012 12:28:58 -0500 Content-Transfer-Encoding: quoted-printable References: <5005EDC0.6050608@stoneleaf.us> <8416AFAF-E201-4F89-B306-D89F920A00FE@leafe.com> <5006F0F7.8030004@stoneleaf.us> To: Ethan Furman X-Mailer: Apple Mail (2.1278) Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342632541 news.xs4all.nl 6866 [2001:888:2000:d::a6]:34877 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25584 On Jul 18, 2012, at 12:16 PM, Ethan Furman wrote: > Your memory is good! I typed it in wrong. Well, I was an MVP for Visual Foxpro for 10 years, so...=20 ;-) > I see four other options: >=20 > 0) don't move the pointer (listed for completeness) > 1) go to that record anyway > 2) go to the next undeleted record > 3) go to the seventh undeleted record (possibly the least practical) > 4) raise an exception >=20 > I still don't like it. Any opinion on the other four choices? I'm = leaning towards 1, possibly with 4 as an option: #4 is probably the most Pythonic approach. The calling code can = then decide how to react to attempting to access a deleted record. Even = if you're accessing data stored in VFP tables, your module should be as = Pythonic as possible. > Part of the reason I feel this is reasonable is that with my dbf = module it is possible to create an index that does /not/ include certain = records: Deleting a record in VFP doesn't remove it from the index; I = believe it marks that index entry as deleted, too. I think that as long = as you treat the deleted status as the same as any other boolean column = you'll be good. -- Ed Leafe