Check for descriptors (in C)

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jun 4 18:58:39 EDT 2007


En Sun, 03 Jun 2007 21:35:05 -0300, Alex Martelli <aleax at mac.com> escribió:

>> My actual use case: I want to check if an object (instance of a class
>> that inherits from file) still uses the original write method or has
>> overriden it.
>
> I'd check for identity between type(o).write and file.write -- seems a
> more direct expression of that thought (and implementable with the C-API
> just as well as with pure Python).

Thanks! It looks obvious now :)

-- 
Gabriel Genellina




More information about the Python-list mailing list