Re: Relative import from script with same name as package

2011-08-14 Thread Oktay Şafak
t __future__ import is supposed to make absolute imports the default, so why is "import thetest" importing thetest.py instead of the package called thetest? Bacause you are running it directly and the PEP and the __future__ statement does not apply here. I hope it is clear now. -- Oktay Şafak -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative import from script with same name as package

2011-08-14 Thread Oktay Şafak
14.08.2011 00:39, OKB (not okblacke) yazmış: I'm using Python 2.6.5. I have a directory structure like this: thetest/ __init__.py thetest.py theother.py __init__.py is an empty file. theother.py contains a function foo(). The package is accessible from sys.path

Re: Is (-1 ==True) True or False? Neither

2009-01-24 Thread Oktay Şafak
Terry Reedy wrote: Oktay Şafak wrote: That's what I'm trying to say: it would be more meaningful if int.__eq__ did a boolean comparison when the other operand is a boolean. For that to be done, int would have to know about its subclass, which generally is bad design. Good poi

Re: Is (-1 ==True) True or False? Neither

2009-01-24 Thread Oktay Şafak
I don't see how fixing this makes harder to treat True and False as first-class objects. If doing the right thing takes some special casing then be it, but I don't think it's so. True in ['something', False] In your semantics, this would evaluate to True because ('something' == True) is True.

Re: Is (-1 ==True) True or False? Neither

2009-01-24 Thread Oktay Şafak
Robert Kern wrote: On 2009-01-24 17:00, oktaysa...@superonline.com wrote: Hi all, I ran into a strange case. Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 ... >>> -1 == True False >>> -1 == False False This works though: >>> if -1: print "OK" OK Af