Re: [Python-Dev] unexpected import behaviour

2010-07-31 Thread Daniel Waterworth
On 31 July 2010 02:21, Alexander Belopolsky alexander.belopol...@gmail.com wrote: On Fri, Jul 30, 2010 at 2:46 PM, Daniel Waterworth da.waterwo...@gmail.com wrote: .. Having thought it through thoroughly, my preference is for a warning. I don't think it's a good practise to import

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Daniel Waterworth
On 29 July 2010 07:32, Daniel Waterworth da.waterwo...@gmail.com wrote: Hi, I'm not sure if this is a bug or not, I certainly didn't expect it. If you create a file called test.py with the following contents, class Test:    pass def test_1():    import test    print Test == test.Test

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Daniel Waterworth
On 30 July 2010 18:32, Michael Foord fuzzy...@voidspace.org.uk wrote: On 30/07/2010 17:59, Oleg Broytman wrote: On Fri, Jul 30, 2010 at 07:26:26AM +0100, Daniel Waterworth wrote: @Oleg: ... This is purely CPython bug-fixing/the discussion of implementation choices.    I am not sure it's

[Python-Dev] unexpected import behaviour

2010-07-29 Thread Daniel Waterworth
Hi, I'm not sure if this is a bug or not, I certainly didn't expect it. If you create a file called test.py with the following contents, class Test: pass def test_1(): import test print Test == test.Test if __name__ == '__main__': test_1() and then run it ($ python test.py),