On 4/25/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:

IIUC, Emin's framework requires you to explicitly declare any class as
abstract that has abstract methods.


I believe that is an easily fixable implementation issue, which I would be
happy to remedy.

I think a bigger issue is whether to check at definition time or check at
instantiation time. It seems to me the former has the benefit of catching
errors earlier and potentially saving time. I don't immediately see the
advantage of the latter (probably that is due to my lack of imagination).

I would like to see the PEP include the ability to (optionally) enforce ABC
requirements at definition time. For example, you could set an attribute (
e.g., __check_abstract__) or inherit from something special if you want to
turn enforcement on (if not checking at def time is the default) or turn it
off (if checking at def time is the default). I am not recommending that
anyone be forced to conform to this to use anything in the standard library.


I think this would be useful, not conflict with the other goals of the PEP,
and be relatively easy to implement in pure python (as illustrated by my
example implementation). If others find this useful (or at least not
objectionable), I would be happy to help with the implementation or writing
additional material for the PEP or even propose it separately if people
think this distracts from the point of the original ABC PEP.

Thanks,
-Emin
_______________________________________________
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

Reply via email to