subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko Čibej <br...@apache.org>
Subject Re: [PATCH] swig-py: restrict *-import to svn_* names
Date Sun, 18 Mar 2012 16:17:22 GMT
On 18.03.2012 16:59, Daniel Shahaf wrote:
> Branko Čibej wrote on Sun, Mar 18, 2012 at 16:54:06 +0100:
>> Yes, but why do this at all?
> So people can do:
>
>>>>>   from svn.fs import *
>>>>>   svn_fs_begin_txn2()
> without polluting their namespace with random names such as "cat" and
> "list" (in the case of svn.client).
>
> Daniel
> (and yes, star-imports are a violation of some PEP. I know.)

I surely think it's the module user's problem to make sure their imports
make sense for their scripts. I don't really care that much about PEPs,
but surely if this works:

import svn.fs
svn.fs.begin_txn2()

then one may (wrongly, but nevertheless) expect that this works as well:

from svn.fs import *
begin_txn2()

At this point I'm sort of scratching my head as to why we even have both
variants of the name in the module.

-- Brane

Mime
View raw message