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/2003-May/035726.html below:

[Python-Dev] a strange case

[Python-Dev] a strange caseWalter Dörwald walter@livinglogic.de
Mon, 19 May 2003 00:19:18 +0200
Guido van Rossum wrote:

>>"Why in the world would you want callable modules you ask?"  I 
>>don't have a real need, but I often see the line blurred between packag=
e, 
>>module, and class.
> 
> Please don't try to blur the line between module and class.  This has
> been proposed many times,

It sounds familiar! ;)

> and the net result IMO is always more
> confusion and no more power.  This is also why in 2.3, modules are no
> longer subclassable.
> 
> If you really need to have a module that has behavior beyond what a
> module can offer, the officially sanctioned way is to stick an
> instance of a class in sys.modules[__name__] from inside the module's
> code.

But reload() won't work for these pseudo modules (See
http://www.python.org/sf/701743). What about the imp module?

> (I would explain more about *why* I think it's a really bad idea, but
> I'm officially on vacation.)

Sure, this can wait.

Bye,
    Walter Dörwald





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