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/2004-May/045069.html below:

[Python-Dev] Why aren't more things weak referencable

[Python-Dev] Why aren't more things weak referencable [Python-Dev] Why aren't more things weak referencableGuido van Rossum guido at python.org
Mon May 31 23:15:08 EDT 2004
> Same here. I wouldnot vote to make strings or tuples or any other
> tiny type weak-reffed in the first place.
> Instead I would add the possible support to derived types, via
> the __slot__ mechanism for instance.
> There is a little coding necessary to make the generic code
> handle the case of var-sized objects, but this is doable
> and not very complicated.
> 
> This may be really needed or not. if we can create the rule
> "every derived type *can* have weak-refs", this is simpler
> to memorize than "well, most can, some cannot".

With some (considerable?) effort, slots on var-sized objects can
certainly be supported -- the same approach as used for __dict__
should work.  I expect it might slow down the normal case a bit,
unless you define a new descriptor type just for this.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list

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