Re: special method in module

2005-11-16 Thread Jan Procházka
Thanks, probably you are right, hacking python in my situation is not neccessary... >Jan Procházka wrote: > > > >>can have modules special methods? >> >> > >no, but you can replace the module object with something that can have >special methods: > >$ more module.py >import sys > >class Modu

Re: special method in module

2005-11-16 Thread Fredrik Lundh
Jan Procházka wrote: > can have modules special methods? no, but you can replace the module object with something that can have special methods: $ more module.py import sys class Module: def __getitem__(self, value): return value sys.modules[__name__] = Module() $ python >>> impor