[EMAIL PROTECTED] wrote:
> I'm having a scoping problem.  I have a module called SpecialFile,
> which defines:
> 
> def open(fname, mode):
>   return SpecialFile(fname, mode)
> 
> class SpecialFile:
> 
>   def __init__(self, fname, mode):
>     self.f = open(fname, mode)
>     ...
> 
[snip]
> 
> How do I tell my class that I want to refer to the __builtin__ open(),
> and not the one defined in the module?

import __builtin__
...
         self.f = __builtin__.open(fname, mode)
...

STeVe
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to