[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] swig-py: restrict *-import to svn_* names

From: Branko Čibej <brane_at_apache.org>
Date: Sun, 18 Mar 2012 17:17:22 +0100

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

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

from svn.fs import *

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
Received on 2012-03-18 17:17:30 CET

This is an archived mail posted to the Subversion Dev mailing list.