[Python-3000] Need help completing ABC pep

Phillip J. Eby pje at telecommunity.com
Sat Apr 21 17:01:55 CEST 2007


At 12:33 PM 4/20/2007 -0700, Talin wrote:
>Additionally, the need to override the classification of an
>object can be done more cleanly using generic functions: In the simplest
>case, one can define a "category membership" generic function that
>simply returns False in the base implementation, and then provide
>overrides that return True for any classes of interest.

Yes, but that's sort of like saying it's better to point a pistol at your 
foot than a shotgun.  :)  Explicitly testing category membership is a bug, 
not a feature; you're far better off defining an overload to do whatever it 
was you were going to make the if-then test do.



More information about the Python-3000 mailing list