On 4/24/07, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 4/24/07, Calvin Spealman <[EMAIL PROTECTED]> wrote: > > Or could __abstractmethods__ be created dynamically? Which would be > > used less, __abstractmethods__ or setting class attributes, that it > > would be OK to be a bit slower? > > I considered that, but __abstractmethods__ gets checked at every class > instantiation (as I understand it). That means that > __abstractmethods__ has to be fast. I assumed that was why Guido > introduced it in the first place...
Check the patch on SF (referenced by the PEP now). The instantiation code only checks a bit in tp_flags, which is set at class creation time iff __abstractmethods__ is non-empty. I'm not sure what the point would be of supporting dynamically modifying ABCs -- it looks like you're just exploring the corners of the semantics rather than providing actual use cases. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
