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/2001-November/018773.html below:

[Python-Dev] gc.garbage

[Python-Dev] gc.garbageTim Peters tim@zope.com
Thu, 29 Nov 2001 17:25:12 -0500
[Neil Schemenauer, on the gc.garbage docs as of about a week ago]
> It's not clear because it's nonsense.  I think I mean to say something
> about the gc.garbage binding.  If you do something like:
>
>     gc.garbage = "ha ha"
>
> then the list is garbage is forever inaccessible from within Python.

I've since tried to repair the docs, to point out that rebinding gc.garbage
is a Bad Idea but mutating it may be a Good one.  BTW, I expect it's more
likely people will get in trouble via:

    gc.garbage = []

I expect that because I did it once <wink>.

> Is there some way to prevent people from assigning to certain module
> variables?

Not that I know of.  If you're terribly concerned, gc could look up
"garbage" in its dict on each access.  That's what, e.g., PRINT_ITEM does
with sys.stdout.  Then it would also have to check that it's a list, etc.

But I'd be keener to see new words spelling out which parts of the gc
interface are and aren't intended "to work" across releases ...




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