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/2002-June/024846.html below:

[Python-Dev] subclass a module?

[Python-Dev] subclass a module? [Python-Dev] subclass a module?David Abrahams David Abrahams" <david.abrahams@rcn.com
Sat, 1 Jun 2002 08:00:53 -0400
From: "Guido van Rossum" <guido@python.org>


> > Can I now subclass from modules?
> 
> It's a bug IMO.  
> 
> > And if so, what good does that do me?
> 
> None whatsoever.  The resulting class cannot be instantiated.

Really?

>>> import re
>>> class X(type(re)):
...     def hello(): print 'hi'
...
>>> newmod = X()
>>> newmod.hello
<bound method X.hello of <module '?' (built-in)>>





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