[Python-Dev] Decimal & returning NotImplemented (or not) (original) (raw)

Neil Schemenauer nas at arctrix.com
Tue Mar 1 23:55:50 CET 2005


On Tue, Mar 01, 2005 at 11:45:43PM +1000, Nick Coghlan wrote:

Interesting. In that case, my other suggestion was to have raising NotImplementedError from a special method be the equivalent of returning NotImplemented (which makes life much easier for a class like Decimal which has an internal method for doing the type conversion).

NotImplementedError has nothing to do with the NotImplemented singleton. It's unfortunate about the naming. IMO, Decimal should be returning NotImplemented instead of raising TypeError. That could be considered a bug but I'd file it under new functionality for the purposes of backporting (i.e. fix it in 2.5 only).

Neil



More information about the Python-Dev mailing list