GvR pointed me to you guys for help in the C implementation of the patch for a dictionary class method: class dict: def fromseq(cls, iterable, value=None): """Return a new dictionary with keys from iterable and values equal to value.""" result = {} for elem in iterable: result[elem] = value return result fromseq = classmethod(fromseq) print dict.fromseq('collaborative') print dict().fromseq('associative') I've already C code the fromseq() as defined as above. The question is how to make it a class method and attach it to the dictionary type object. If you can help, please send me a note. Thanks in advance. BTW, I know this is ordinarily not the place to ask for help, but there are only a handful of people who understand descriptors at the C level (and most of them are currently 100% consumed by Zope priorities). Raymond Hettinger
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