Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26533

Re: dbf.py API question

Date 2012-08-05 07:09 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: dbf.py API question
References <501AA304.3090000@stoneleaf.us> <CAPz=1FSPc7cfxn+rbRWwo67SjOXV_DmOO=_R1tq2jLTkOXsntQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2961.1344176168.4697.python-list@python.org> (permalink)

Show all headers | View raw


Ole Martin Bjørndalen wrote:
> On Thu, Aug 2, 2012 at 5:55 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
>> SQLite has a neat feature where if you give it a the file-name of ':memory:'
>> the resulting table is in memory and not on disk.  I thought it was a cool
>> feature, but expanded it slightly: any name surrounded by colons results in
>> an in-memory table.
>>
>> I'm looking at the same type of situation with indices, but now I'm
>> wondering if the :name: method is not pythonic and I should use a flag
>> (in_memory=True) when memory storage instead of disk storage is desired.
>>
>> Thoughts?
> 
> I agree that the flag would be more pythonic in dbf.py.
> 
> I was not aware that you are adding sqlite functionality to your
> library. This is very cool!

Actually, I'm not.  I had stumbled across that one tidbit and thought it 
was cool, but cool is not always pythonic.  ;)


> I am considering adding a "streaming=True" flag which would make the
> table class a record generator,

You can do this by implementing either __getitem__ or __iter__, unless 
the streaming flag would also make your table not in memory.


> I hope this can help you somehow in your decision making process.

All comments appreciated.  Thanks!

~Ethan~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: dbf.py API question Ethan Furman <ethan@stoneleaf.us> - 2012-08-05 07:09 -0700

csiph-web