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

[Python-Dev] a strange case

[Python-Dev] a strange case [Python-Dev] a strange caseGuido van Rossum guido@python.org
Sun, 18 May 2003 16:42:34 -0400
> "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 package, 
> module, and class.

Please don't try to blur the line between module and class.  This has
been proposed many times, 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.

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

--Guido van Rossum (home page: http://www.python.org/~guido/)




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