[Python-3000] Need help completing ABC pep (original) (raw)
Phillip J. Eby pje at telecommunity.com
Sat Apr 21 17:01:55 CEST 2007
- Previous message: [Python-3000] Need help completing ABC pep
- Next message: [Python-3000] Need help completing ABC pep
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: [Python-3000] Need help completing ABC pep
- Next message: [Python-3000] Need help completing ABC pep
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]