From: Fred L. D. Jr. <fd...@ac...> - 2004-07-23 21:28:33
|
On Friday 23 July 2004 05:17 pm, David Goodger wrote: > banner. I still want to use Banner.Banner.get_banner to do it, but > much of that class is double-underscore-class-private. Which makes it > a royal pain to subclass. Yes, it does. ;-( > What's reason for all this __privacy? I can see that with so many > mixin classes, there's a risk of namespace collision. But that's > pretty easy to avoid. Any other reason? This is a phenomenon known as "Barrynoia." If you work with people named Barry long enough, you start to recognize it. > Any objection to refactoring the guts of ht2html to remove all this > __privacy? Not from me! > My first thought is to replace class-private method and > attribute names with single-underscore names, qualified with the class > name. So Banner.__links becomes Banner._banner_links. Basically what > class-privacy does, but in a non-magical form. Actually, I'd be inclined to remove all the inheritance, and use aggregation and delegation instead. But that's an ever bigger task, and there's been little interest (at least from me) and no time. So knock yourself out! I'm sure the extensive test suite will make your task swift and pleasant. ;-( ;-( ;-( -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> |