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/066621.html below:

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

[Python-Dev] PEP 328 and PEP 338, reduxNicko van Someren nicko at nicko.org
Tue Jun 27 17:23:16 CEST 2006
On 27 Jun 2006, at 13:03, Nick Coghlan wrote:
> ...
> It occurred to me that a slight modification to PEP 338 might solve  
> the
> problem fairly cleanly: instead of simply setting __name__ to  
> '__main__' for a
> module in a package, the -m switch could prepend the package name  
> so that
> relative imports can work correctly.
>
> Inside the module, the test for "am I the main module" would need  
> to be
> "__name__.endswith('__main__')" instead of "__name__ ==  
> '__main__'", but other
> than that, there should be very little impact.

Hum... other than effecting more or less every runnable python module  
around it should be very little impact.  That sounds like quite a bit  
of impact to me!

	Nicko

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