Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-06-20 Thread Clark C. Evans
+1 Excellent Change +1 Minimal Backward Compatibility Difficulties I think this would also help quite a bit with newbie adoption of Python. I've had to explain this un-feature on numerous occassions and it given how smart Python is, I've wondered why it has this requirement. If you look in vario

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-28 Thread Martin v. Löwis
Thomas Wouters wrote: > Indeed! I hadn't realized that, although I might've if I'd been able to > find where Modules is put on sys.path. And, likewise, I would do as you > suggest (which feels like the right thing) if I could only find out > where Modules is put on sys.path :) I don't have time to

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-28 Thread Thomas Wouters
On 4/28/06, Thomas Heller <[EMAIL PROTECTED]> wrote: Would not another way be to make sure Modules is moved *behind* thesetup.py build directory on sys.path?Indeed! I hadn't realized that, although I might've if I'd been able to find where Modules is put on sys.path. And, likewise, I would do as y

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-28 Thread Thomas Heller
Thomas Wouters wrote: > On 4/27/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: >> Alrighty then. The list has about 12 hours to convince me (and you) that >> it's a bad idea to generate that warning. I'll be asleep by the time the >> trunk un-freezes, and I have a string of early meetings tomorrow.

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Guido van Rossum
On 4/27/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: > I could check it in, except the make-testall I ran overnight showed a small > problem: the patch would generate a number of spurious warnings in the > trunk: > > /home/thomas/python/python/trunk/Lib/gzip.py:9: > ImportWarning: Not importing di

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Gustavo Carneiro
On 4/27/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: On 4/27/06, Gustavo Carneiro < [EMAIL PROTECTED]> wrote: Besides, Guido's original proposal is not a fix for your problem, either; he only proposes to change the requirement for *sub*packages.   It *is* a solution for my problem.  I don't need

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Thomas Wouters
On 4/27/06, Gustavo Carneiro <[EMAIL PROTECTED]> wrote: Besides, Guido's original proposal is not a fix for your problem, either; he only proposes to change the requirement for *sub*packages.   It *is* a solution for my problem.  I don't need the __init__.py file for anything, since I don't need a

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Gustavo Carneiro
On 4/27/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: On 4/27/06, Gustavo Carneiro < [EMAIL PROTECTED]> wrote: On 4/27/06, Phillip J. Eby < [EMAIL PROTECTED]> wrote: At 03:48 PM 4/27/2006 +0200, Bernhard Herzog wrote:>"Gustavo Carneiro" <[EMAIL PROTECTED] > writes:>> >   Now the problem.  Suppose

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Thomas Wouters
On 4/27/06, Gustavo Carneiro <[EMAIL PROTECTED]> wrote: On 4/27/06, Phillip J. Eby < [EMAIL PROTECTED]> wrote: At 03:48 PM 4/27/2006 +0200, Bernhard Herzog wrote:>"Gustavo Carneiro" <[EMAIL PROTECTED] > writes:>> >   Now the problem.  Suppose you have the source package python-foo-bar, > > which in

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Gustavo Carneiro
On 4/27/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: At 03:48 PM 4/27/2006 +0200, Bernhard Herzog wrote:>"Gustavo Carneiro" <[EMAIL PROTECTED]> writes:>> >   Now the problem.  Suppose you have the source package python-foo-bar, > > which installs $pythondir/foo/__init__.py and $pythondir/foo/bar.p

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Phillip J. Eby
At 03:48 PM 4/27/2006 +0200, Bernhard Herzog wrote: >"Gustavo Carneiro" <[EMAIL PROTECTED]> writes: > > > Now the problem. Suppose you have the source package python-foo-bar, > > which installs $pythondir/foo/__init__.py and $pythondir/foo/bar.py. This > > would make a module called "foo.bar" a

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Thomas Wouters
On 4/27/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: Alrighty then. The list has about 12 hours to convince me (and you) that it's a bad idea to generate that warning. I'll be asleep by the time the trunk un-freezes, and I have a string of early meetings tomorrow. I'll get to it somewhere in the a

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Bernhard Herzog
"Gustavo Carneiro" <[EMAIL PROTECTED]> writes: > Now the problem. Suppose you have the source package python-foo-bar, > which installs $pythondir/foo/__init__.py and $pythondir/foo/bar.py. This > would make a module called "foo.bar" available. Likewise, you can have the > source package pytho

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Gustavo Carneiro
On 4/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:[...] So I have a very simple proposal: keep the __init__.py requirement fortop-level pacakages, but drop it for subpackages. This should be asmall change. I'm hesitant to propose *anything* new for Python 2.5,so I'm proposing it for 2.6; if N

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread skip
>> Not that it would count in any way, but I'd prefer to keep it. How >> would I mark a subdirectory as "not-a-package" otherwise? Guido> What's the use case for that? Have you run into this requirement? Yes, we run into it. We typically install a package with any resources in a res

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread skip
Guido> One particular egregious problem is that *subpackage* are subject Guido> to the same rule. It so happens that there is essentially only Guido> one top-level package in the Google code base, and it already has Guido> an __init__.py file. But developers create new subpackages

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Nick Coghlan
Guido van Rossum wrote: > So I have a very simple proposal: keep the __init__.py requirement for > top-level pacakages, but drop it for subpackages. This should be a > small change. I'm hesitant to propose *anything* new for Python 2.5, > so I'm proposing it for 2.6; if Neal and Anthony think this

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Fredrik Lundh
Guido van Rossum wrote: > So I have a very simple proposal: keep the __init__.py requirement for > top-level pacakages, but drop it for subpackages. This should be a > small change. I'm hesitant to propose *anything* new for Python 2.5, > so I'm proposing it for 2.6; if Neal and Anthony think this

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Talin
Guido van Rossum python.org> writes: > The requirement that a directlry must contain an __init__.py file > before it is considered a valid package has always been controversial. > It's designed to prevent the existence of a directory with a common > name like "time" or "string" from preventing fu

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Anthony Baxter
On Thursday 27 April 2006 17:47, Paul Moore wrote: > FWIW, I still have every confidence in your judgement about > features. However, I'd have to say that your timing sucks :-) Your > initial message read to me as "Quick! I'm about to get lynched here > - can I have the OK to shove this change in b

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Paul Moore
On 4/27/06, Paul Moore <[EMAIL PROTECTED]> wrote: > However, I'd have to say that your timing sucks :-) Your initial > message read to me as "Quick! I'm about to get lynched here - can I > have the OK to shove this change in before a2 goes out?" And this just proves that my response wasn't anywher

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-27 Thread Paul Moore
On 4/27/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 4/26/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: > > Of course, I only consider *my* reasons to be valid, and mine weren't > > knee-jerk or tool-related. I don't think Python should be going "Oh, what > > you wanted wasn't possible, but

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Aahz
On Wed, Apr 26, 2006, Guido van Rossum wrote: > > Which is why I said earlier that I felt disappointed that we can't > change anything any more. I've been here since Python 1.5.1. I don't understand why this issue in particular makes you feel disappointed. I also think your statement is just pla

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: > Indeed. I think the problem many of us have with the proposal isn't the new > behavior, but the change in the behavior. That's certainly it for me. Which is why I said earlier that I felt disappointed that we can't change anything any m

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Fred L. Drake, Jr.
On Wednesday 26 April 2006 22:42, Barry Warsaw wrote: > So I suspect > you're right when you say that if the rule had already been relaxed and > you were now proposing to tighten the rules, we probably get just as > many complaints. Indeed. I think the problem many of us have with the proposa

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Barry Warsaw
Boy, threads here sure move fast when there's work to be done :). Although largely moot now, I'll follow up for posterity's sake. On Wed, 2006-04-26 at 10:59 -0700, Guido van Rossum wrote: > Oh, cool gray area. I propose that if there's no __init__.py it prints > '/sub1/sun2/' i.e. with a trailin

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Anthony Baxter <[EMAIL PROTECTED]> wrote: > On Thursday 27 April 2006 06:49, Guido van Rossum wrote: > > OK, forget it. I'll face the pitchforks. > > > > I'm disappointed though -- it sounds like we can never change > > anything about Python any more because it will upset the oldtimers.

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Anthony Baxter
On Thursday 27 April 2006 06:49, Guido van Rossum wrote: > OK, forget it. I'll face the pitchforks. > > I'm disappointed though -- it sounds like we can never change > anything about Python any more because it will upset the oldtimers. I'm not averse to changing this - just not to changing it on s

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Anthony Baxter
On Thursday 27 April 2006 05:50, Phillip J. Eby wrote: > Anyway, I'm not opposed to the idea of supporting this in future > Pythons, but I definitely think it falls under the "but sometimes > never is better than RIGHT now" rule where 2.5 is concerned. :) I agree fully. I don't think we should t

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 04:57 PM 4/26/2006 -0700, Guido van Rossum wrote: >On 4/26/06, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > > Possibly. Perhaps it would be useful to have `is_package(dirname)`, > > `is_rootpackage(dirname)` and `is_subpackage(dirname)` functions > > somewhere (pkgutils?). > >YAGNI. Also

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > Potential packages later in the path won't be > warned about. If you're trying to resolve import problems, it's just as > likely that the package you really want is later in sys.path than > earlier. But module hiding is a feature, and

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 01:10 AM 4/27/2006 +0200, Thomas Wouters wrote: >On 4/27/06, Guido van Rossum <[EMAIL PROTECTED]> >wrote: >>I'd worry that it'll cause complaints when the warning is incorrect >>and a certain directory is being skipped intentionally. E.g. the >>"string" directory that

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Delaney, Timothy (Tim)
Guido van Rossum wrote: > The difference is that if you find a valid module package later on the > path, you'll still get warnings. This is the bit I don't like about it. Currently the warnings are displayed as the packages are found. I'd be quite happy with the warnings if they were suppressed u

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Delaney, Timothy (Tim) <[EMAIL PROTECTED]> wrote: > I really think it would be more useful having an ImportError containing > a suggestion than having a warning. Anyone who knows it's bogus can just > ignore it. That's effectively what Thomas's patch does though -- if at the end the pa

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: > Of course, I only consider *my* reasons to be valid, and mine weren't > knee-jerk or tool-related. I don't think Python should be going "Oh, what > you wanted wasn't possible, but I think I know what you wanted, let me do it > for you", first

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Delaney, Timothy (Tim)
Guido van Rossum wrote: >> http://python.org/sf/1477281 >> >> (You can call it 'oldtimer-repellant' if you want to use it to >> convince people there isn't any *real* backward-compatibility issue.) > > I'd worry that it'll cause complaints when the warning is incorrect > and a certain directory

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Thomas Wouters
On 4/27/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 4/26/06, Thomas Wouters <[EMAIL PROTECTED]> wrote:>>> On 4/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > OK, forget it. I'll face the pitchforks.>>> Maybe this'll help:>> http://python.org/sf/1477281>> (You can call it 'oldtimer-re

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Thomas Wouters <[EMAIL PROTECTED]> wrote: > > > On 4/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > OK, forget it. I'll face the pitchforks. > > > Maybe this'll help: > > http://python.org/sf/1477281 > > (You can call it 'oldtimer-repellant' if you want to use it to convince > p

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Thomas Wouters
On 4/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: OK, forget it. I'll face the pitchforks.Maybe this'll help:http://python.org/sf/1477281 (You can call it 'oldtimer-repellant' if you want to use it to convince people there isn't any *real* backward-compatibility issue.) I'm disappointed thoug

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Ian Bicking
Joe Smith wrote: > It seems to me that the right way to fix this is to simply make a small > change to the error message. > On a failed import, have the code check if there is a directory that would > have been the requested package if > it had contained an __init__ module. If there is then appe

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Terry Reedy
"Phillip J. Eby" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >>It might also be good to check that the directory actually contained >>python >>modules. > > This is a great idea, but might be hard to implement in practice with the > current C implementation of import, at least for

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread James Y Knight
On Apr 26, 2006, at 4:49 PM, Guido van Rossum wrote: > OK, forget it. I'll face the pitchforks. > > I'm disappointed though -- it sounds like we can never change anything > about Python any more because it will upset the oldtimers. > No, you can not make a change which has a tiny (and arguably n

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 01:49 PM 4/26/2006 -0700, Guido van Rossum wrote: > >OK, forget it. I'll face the pitchforks. > > > >I'm disappointed though -- it sounds like we can never change anything > >about Python any more because it will upset the oldtimers. > > I

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Terry Jones <[EMAIL PROTECTED]> wrote: > I would suggest adding a hook to their version control system to > automatically create (and preferably also check out) an __init__.py file > whenever a new (source code) directory was placed under version control > (supposing you can distinguish

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 01:49 PM 4/26/2006 -0700, Guido van Rossum wrote: >OK, forget it. I'll face the pitchforks. > >I'm disappointed though -- it sounds like we can never change anything >about Python any more because it will upset the oldtimers. I know exactly how you feel. :) But there's always Python 3.0, and

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Terry Jones
It might be helpful to consider how people would tackle Guido's problem by pretending that a regular Joe (i.e., someone who couldn't consider changing the semantics of Python itself) had asked this question. I would suggest adding a hook to their version control system to automatically create (and

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 04:33 PM 4/26/2006 -0400, Joe Smith wrote: >It seems to me that the right way to fix this is to simply make a small >change to the error message. >On a failed import, have the code check if there is a directory that would >have been the requested package if >it had contained an __init__ module.

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
OK, forget it. I'll face the pitchforks. I'm disappointed though -- it sounds like we can never change anything about Python any more because it will upset the oldtimers. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev ma

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Joe Smith
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > (Context: There's a large crowd with pitchforks and other sharp pointy > farm implements just outside the door of my office at Google. They are > making an unbelievable racket. It appears they are Google engineers >

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Martin v. Löwis
Phillip J. Eby wrote: >> I assume you want >> >> import x.y >> >> to fail if y is an empty directory (or non-empty, but without .py >> files). I don't see a value in implementing such a restriction. > > No, I'm saying that tools which are looking for packages and asking, "Is > this directory a pac

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Martin v. Löwis
Phillip J. Eby wrote: > At 11:50 AM 4/26/2006 -0700, Guido van Rossum wrote: >> I'm not sure what you mean by "one directory read". You'd have to list >> the entire directory, which may require reading more than one block if >> the directory is large. > > You have to do this to find an __init__.py

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 09:56 PM 4/26/2006 +0200, Martin v. Löwis wrote: >Phillip J. Eby wrote: > > My counter-proposal: to be considered a package, a directory must contain > > at least one module (which of course can be __init__). This allows the > "is > > it a package?" question to be answered with only one direct

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Wolfgang Langner
On 4/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > So I have a very simple proposal: keep the __init__.py requirement for > top-level pacakages, but drop it for subpackages. This should be a > small change. I'm hesitant to propose *anything* new for Python 2.5, > so I'm proposing it for 2.6

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Martin v. Löwis
Phillip J. Eby wrote: > My counter-proposal: to be considered a package, a directory must contain > at least one module (which of course can be __init__). This allows the "is > it a package?" question to be answered with only one directory read, as is > the case now. Think of it also as a nudg

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 11:50 AM 4/26/2006 -0700, Guido van Rossum wrote: >I'm not sure what you mean by "one directory read". You'd have to list >the entire directory, which may require reading more than one block if >the directory is large. You have to do this to find an __init__.py too, don't you? Technically, th

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Donovan Baarda
Guido van Rossum wrote: > On 4/26/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > >>On Wed, 2006-04-26 at 10:16 -0700, Guido van Rossum wrote: >> >> >>>So I have a very simple proposal: keep the __init__.py requirement for >>>top-level pacakages, but drop it for subpackages. This should be a >>>smal

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Fred L. Drake, Jr.
On Wednesday 26 April 2006 15:05, André Malo wrote: > Another point is that one can even hide supplementary packages within such > a subdirectory. It's only visible to scripts inside the dir (I admit, that > the latter is not a real usecase, just a thought that came up while > writing this up).

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread M.-A. Lemburg
Guido van Rossum wrote: > On 4/26/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >> At 10:16 AM 4/26/2006 -0700, Guido van Rossum wrote: >>> So I have a very simple proposal: keep the __init__.py requirement for >>> top-level pacakages, but drop it for subpackages. >> Note that many tools exist whic

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread André Malo
* Guido van Rossum wrote: [me] > > Actually I have no problems with the change from inside python, but > > from the POV of tools, which walk through the directories, > > collecting/separating python packages and/or supplemental data > > directories. It's an explicit vs. implicit issue, where impli

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread M.-A. Lemburg
Guido van Rossum wrote: > On 4/26/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: >> On Wed, 2006-04-26 at 10:16 -0700, Guido van Rossum wrote: >> >>> So I have a very simple proposal: keep the __init__.py requirement for >>> top-level pacakages, but drop it for subpackages. This should be a >>> small

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 10:16 AM 4/26/2006 -0700, Guido van Rossum wrote: > >So I have a very simple proposal: keep the __init__.py requirement for > >top-level pacakages, but drop it for subpackages. > > Note that many tools exist which have grown to rely on the

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, André Malo <[EMAIL PROTECTED]> wrote: > * Guido van Rossum wrote: > > > On 4/26/06, André Malo <[EMAIL PROTECTED]> wrote: > > > * Guido van Rossum wrote: > > > > So I have a very simple proposal: keep the __init__.py requirement > > > > for top-level pacakages, but drop it for subpackag

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread David Goodger
Sounds a bit like the tail wagging the dog. I thought the Google geeks were a smart bunch. ISTM that something like Phillip Eby's code would be the most expedient solution. I would add one extension: if a package directory without an __init__.py file *is* encountered, an empty __init__.py file sho

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Thomas Wouters
On 4/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 4/26/06, Benji York <[EMAIL PROTECTED]> wrote:> Guido van Rossum wrote:> > So I have a very simple proposal: keep the __init__.py requirement for> > top-level pacakages, but drop it for subpackages. I don't particularly like it. You still n

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 02:07 PM 4/26/2006 -0400, Phillip J. Eby wrote: > def find_module(self, fullname, path=None): > # Note: we ignore 'path' argument since it is only used via >meta_path > subname = fullname.split(".")[-1] > if os.path.isdir(os.path.join(self.path, su

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Phillip J. Eby
At 10:16 AM 4/26/2006 -0700, Guido van Rossum wrote: >So I have a very simple proposal: keep the __init__.py requirement for >top-level pacakages, but drop it for subpackages. Note that many tools exist which have grown to rely on the presence of __init__ modules. Also, although your proposal wo

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread André Malo
* Guido van Rossum wrote: > On 4/26/06, André Malo <[EMAIL PROTECTED]> wrote: > > * Guido van Rossum wrote: > > > So I have a very simple proposal: keep the __init__.py requirement > > > for top-level pacakages, but drop it for subpackages. This should be > > > a small change. I'm hesitant to prop

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > On Wed, 2006-04-26 at 10:16 -0700, Guido van Rossum wrote: > > > So I have a very simple proposal: keep the __init__.py requirement for > > top-level pacakages, but drop it for subpackages. This should be a > > small change. I'm hesitant to prop

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Barry Warsaw
On Wed, 2006-04-26 at 10:16 -0700, Guido van Rossum wrote: > So I have a very simple proposal: keep the __init__.py requirement for > top-level pacakages, but drop it for subpackages. This should be a > small change. I'm hesitant to propose *anything* new for Python 2.5, > so I'm proposing it for

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, Benji York <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > So I have a very simple proposal: keep the __init__.py requirement for > > top-level pacakages, but drop it for subpackages. > > So this would mean that current non-package subdirectories in a package > (that contain th

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Guido van Rossum
On 4/26/06, André Malo <[EMAIL PROTECTED]> wrote: > * Guido van Rossum wrote: > > > So I have a very simple proposal: keep the __init__.py requirement for > > top-level pacakages, but drop it for subpackages. This should be a > > small change. I'm hesitant to propose *anything* new for Python 2.5,

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread Benji York
Guido van Rossum wrote: > So I have a very simple proposal: keep the __init__.py requirement for > top-level pacakages, but drop it for subpackages. So this would mean that current non-package subdirectories in a package (that contain things like data files or configuration info) would become pa

Re: [Python-Dev] Dropping __init__.py requirement for subpackages

2006-04-26 Thread André Malo
* Guido van Rossum wrote: > So I have a very simple proposal: keep the __init__.py requirement for > top-level pacakages, but drop it for subpackages. This should be a > small change. I'm hesitant to propose *anything* new for Python 2.5, > so I'm proposing it for 2.6; if Neal and Anthony think th