A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/066698.html below:

[Python-Dev] PEP 328 and PEP 338, redux

[Python-Dev] PEP 328 and PEP 338, redux [Python-Dev] PEP 328 and PEP 338, reduxGuido van Rossum guido at python.org
Wed Jun 28 18:45:24 CEST 2006
On 6/28/06, Nick Coghlan <ncoghlan at gmail.com> wrote:

> The workaround to replace __name__ with __module_name__ in order to enable
> relative imports turned out to be pretty ugly, so I also worked up a patch to
> import.c to get it to treat __module_name__ as an override for __name__ when
> __name__ == '__main__'.

Ah, clever. +1.

> So given a test_foo.py that started like this:
>
>    import unittest
>    import ..foo

Um, that's not legal syntax last I looked. Leading dots can only be
used in "from ... import". Did you change that too? I really hope you
didn't!

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4