On 4/25/07, Josiah Carlson <[EMAIL PROTECTED]> wrote: > "Emin.shopper Martinian.shopper" <[EMAIL PROTECTED]> wrote: > > On 4/25/07, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > If your unit tests take hours to run, then you aren't going to get > > > anything useful from the ABC requirements for hours either (unless you > > > are pre-instantiating everything you are going to use during program > > > execution, in which case this could become your unittest). > > > > No, the ABC requirements are checked as soon as a module is imported (i.e., > > classes are checked at definition time not when an instance is created). I > > have been using my own ABC implementation for quite a while and it has > > repeatedly proven it's value when I create a new derived class and forget to > > implement a necessary method. > > But that is not part of the ABC PEP (according to my most recent reading). > See the "ABC Support Framework" portion. Only instantiation triggers > the "you didn't implement method X". Certainly you can add metaclasses > to handle checking for "does class X implement method Y", but it isn't > going to be included out of the box. > > > I'm not claiming that is the only benefit of ABCs. I'm just pointing out > > what I find to be a very useful feature of ABCs that I hope makes into > > python. > > I doubt this particular feature will make it in. It seems too > "B&D"-static typing to me (and others).
IIUC, Emin's framework requires you to explicitly declare any class as abstract that has abstract methods. IMO this is a requirement to redundancy which I find unpythonic. So indeed I am not about to add this to the PEP. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com