[Python-ideas] Revised**11 PEP on Yield-From

Jacob Holm jh at improva.dk
Sat Apr 18 03:44:13 CEST 2009


Greg Ewing wrote:
> Jacob Holm wrote:
> 
>> Note that treating None as missing might actually be useful by making 
>> it easier to "hide" the throw() or close() method of a base class from 
>> yield-from.  IIRC there is a precedent for treating None this way in 
>> the handling of hash().
> 
> In the case of hash() there's a specific reason for wanting
> to be able to hide the base method. You'd have to justify
> wanting to be able to do the same for send() and throw()
> in particular.
> 

I don't care much either way.  Providing a property that raises 
AttributeError is almost as easy as using None if you really need it.

- Jacob



More information about the Python-ideas mailing list