Re: dbf.py API question

Discussion in 'Python' started by Ethan Furman, Aug 5, 2012.

  1. Ethan Furman

    Ethan Furman Guest

    Ole Martin Bjørndalen wrote:
    > On Thu, Aug 2, 2012 at 5:55 PM, Ethan Furman <> 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~
     
    Ethan Furman, Aug 5, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ethan Furman

    API design question for dbf.py

    Ethan Furman, Jul 6, 2012, in forum: Python
    Replies:
    0
    Views:
    167
    Ethan Furman
    Jul 6, 2012
  2. MRAB
    Replies:
    0
    Views:
    167
  3. Ethan Furman

    Re: API design question for dbf.py

    Ethan Furman, Jul 6, 2012, in forum: Python
    Replies:
    0
    Views:
    166
    Ethan Furman
    Jul 6, 2012
  4. Devin Jeanpierre

    Re: API design question for dbf.py

    Devin Jeanpierre, Jul 7, 2012, in forum: Python
    Replies:
    0
    Views:
    173
    Devin Jeanpierre
    Jul 7, 2012
  5. Ethan Furman

    Re: API design question for dbf.py

    Ethan Furman, Jul 7, 2012, in forum: Python
    Replies:
    0
    Views:
    166
    Ethan Furman
    Jul 7, 2012
Loading...

Share This Page