[Python-3000] dbm package creation

Guido van Rossum guido at python.org
Tue May 27 18:49:47 CEST 2008


On Sun, May 25, 2008 at 3:08 PM, Brett Cannon <brett at python.org> wrote:
> On Sun, May 25, 2008 at 12:21 PM, Georg Brandl <g.brandl at gmx.net> wrote:
>> Hi,
>>
>> I'll handle the PEP 3108 dbm package if nobody else is already at it.
>>
>
> I know I have not started the work.
>
>> Two questions though:
>>
>> * the whichdb() function returns strings that are module names.  These
>>  names won't be importable anymore in 3k.  Should the return values
>>  remain the same in 3k, or should whichdb() return the new names, and
>>  if the latter, including "dbm." or not?
>>
>
> New names with the package name prepended.
>
> Should probably change the API at some point to just return the module
> to use instead of the name.

I'm not sure I disagree. I see the return value as an enum, only one
use for which is to import it. (If you wanted to just use the module,
why not use anydbm?) I'd prefer to keep the return strings the same
(no 'dbm.' prefix) and fix the code that uses whichdb.

Or is there an expected future use case where the returned value would
be something in a *different* package?

Returning a module object would seem the least attractive version --
that would require importing the module, which may not be in the
caller's plan at all.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list