module __call__

Dirck Blaskey dirck at pacbell.net
Wed Apr 19 01:23:43 CEST 2000


Fredrik Lundh <effbot at telia.com> wrote in message
news:7N4L4.497$wYl.191816704 at newsb.telia.net...
> Dirck Blaskey <dirck at pacbell.net> wrote:
> > ...Gee-Wouldn't-It-Be-Nice-If...
> >
> > modules could def __call__():
> >
> > so you could call a module, i.e.
> >
> >     import StringIO
> >     f = StringIO()
>
> and
>
> class myStringIO(StringIO):
>     ...
>
> would explode in your face.  lousy idea.

Hmm...

    class myStringIO(StringIO):

already doesn't work;
you have to

    class myStringIO(StringIO.StringIO):

as currently implemented.

d






More information about the Python-list mailing list