A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-list/2001-April/082859.html below:

'mapping' in weakrefs unneeded?

'mapping' in weakrefs unneeded? 'mapping' in weakrefs unneeded?Andrew Dalke dalke at acm.org
Mon Apr 9 20:57:27 EDT 2001
I wrote in message <9amdk2$82i$1 at slb0.atl.mindspring.net>...
>(Repost from a mail I sent to python-dev
>http://mail.python.org/pipermail/python-dev/2001-March/01
>which garnered no reponse.  Anyone here want to ignore it :)

I guess that would be a "yes to all".

Last call!

>  I'm starting to learn how to use weakrefs.  I'm curious
>about the function named 'mapping'.  It is implemented as:
>
>> def mapping(dict=None,weakkeys=0):
>>     if weakkeys:
>>         return WeakKeyDictionary(dict)
>>     else:
>>         return WeakValueDictionary(dict)
>
>Why is this a useful function?  Shouldn't people just call
>WeakKeyDictionary and WeakValueDictionary directly instead
>of calling mapping with a parameter to specify which class
>to construct?
>
>If anything, this function is very confusing

 [...]

                    Andrew
                    dalke at acm.org




More information about the Python-list 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