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/2000-November/010346.html below:

[Python-Dev] Re: Dynamic nested scopes

[Python-Dev] Re: Dynamic nested scopes [Python-Dev] Re: Dynamic nested scopesGuido van Rossum guido@python.org
Fri, 03 Nov 2000 10:36:22 -0500
[Barry]
> I'm a little confused.  I've occasionally done the following within an
> application:
> 
> ----------driver.py
> # need to override built-in open() to do extra debugging
> def debuggin_open(filename, mode, bufsize):
>     # ...
> if EXTRA_DEBUGGING:
>     import __builtin__.__dict__['open'] = debugging_open
> -------------------- snip snip --------------------
> 
> Would this be illegal?  Would other modules in my application (even if
> imported from the standard library!) automatically get
> debugging_open() for open() like they do now?

That's up for discussion.  Note that the open() function is special in
this respect -- I don't see you doing the same to range() or hash().

If this is deemed a useful feature (for open()), we can make a rule
about which built-ins you cannot override like this and which ones you
can.

--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