<br><div class="gmail_quote">On Fri, Jun 8, 2012 at 3:48 PM, Ian Kelly <span dir="ltr"><<a href="mailto:ian.g.kelly@gmail.com" target="_blank">ian.g.kelly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, Jun 8, 2012 at 4:24 PM, Dan Stromberg <<a href="mailto:drsalists@gmail.com">drsalists@gmail.com</a>> wrote:<br>
> Am I misinterpreting this?  It seems like according to the PEP, I should<br>
> have still been able to import treap.py despite having a treap/.  But I<br>
> couldn't; I had to rename treap/ to treap-dir/ first.<br>
<br>
</div>That's how I understand it.  The existence of a module or regular<br>
package 'foo' anywhere in the path should trump the creation of a<br>
'foo' namespace package, even if the namespace package would be<br>
earlier in the path.  Ar you sure you don't have an __init__.py in<br>
your treap directory?<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br><br>The issue replicated in a minimal way (it's in the ticket too):<br><br> dstromberg@zareason-limbo6000a /tmp/tt $ mv treap treap-dir<br>
<br>dstromberg@zareason-limbo6000a /tmp/tt $ /usr/local/cpython-3.3/bin/python -c 'import sys; print(sys.path); import treap; t = treap.treap()'<br>['', '/usr/local/cpython-3.3/lib/python33.zip', '/usr/local/cpython-3.3/lib/python3.3', '/usr/local/cpython-3.3/lib/python3.3/plat-linux', '/usr/local/cpython-3.3/lib/python3.3/lib-dynload', '/usr/local/cpython-3.3/lib/python3.3/site-packages']<br>
<br>dstromberg@zareason-limbo6000a /tmp/tt $ mv treap-dir/ treap<br><br>dstromberg@zareason-limbo6000a /tmp/tt $ /usr/local/cpython-3.3/bin/python -c 'import sys; print(sys.path); import treap; t = treap.treap()'<br>
['', '/usr/local/cpython-3.3/lib/python33.zip', '/usr/local/cpython-3.3/lib/python3.3', '/usr/local/cpython-3.3/lib/python3.3/plat-linux', '/usr/local/cpython-3.3/lib/python3.3/lib-dynload', '/usr/local/cpython-3.3/lib/python3.3/site-packages']<br>
Traceback (most recent call last):<br>  File "<string>", line 1, in <module><br>AttributeError: 'module' object has no attribute 'treap'<br><br>dstromberg@zareason-limbo6000a /tmp/tt $ ls -l treap/__init__.py<br>
ls: cannot access treap/__init__.py: No such file or directory<br><br>dstromberg@zareason-limbo6000a /tmp/tt $ /usr/local/cpython-3.3/bin/python<br>Python 3.3.0a4 (default, Jun  8 2012, 14:14:41)<br>[GCC 4.6.1] on linux<br>
Type "help", "copyright", "credits" or "license" for more information.<br>>>><br><br>Thanks!<br><br></div></div>