E&S CVS Commit: PyProtocols - Refactor a portion of the predicate dispatch machinery so that dispatch

pje at eby-sarna.com pje at eby-sarna.com
Thu Jul 8 00:00:00 EDT 2004


Module Name:	PyProtocols
Committed By:	pje
Date:		Thu Jul  8 03:59:51 UTC 2004

Modified Files:
	PyProtocols: TODO.txt
	PyProtocols/src/protocols: dispatch.py
	PyProtocols/src/protocols/tests: test_dispatch.py

Log Message:
Refactor a portion of the predicate dispatch machinery so that dispatch
functions can request a new key be added to a dispatch node, thus allowing
a fix for a problem with multiple inheritance.  Using MRO order is a fine
optimization for adapter lookups, but it's not the right thing for dispatch
nodes.  Instead, we now walk '__bases__', but only so long as there is
a single base.  The moment we hit a class with more than one base, we force
a specific (but slower) calculation of the dispatch subtree for that
class.  (Of course, it's then cached so future lookups for that class and
its subclasses won't need to repeat the recalculation.)


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PyProtocols/TODO.txt.diff?r1=1.4&r2=1.5
http://cvs.eby-sarna.com/PyProtocols/src/protocols/dispatch.py.diff?r1=1.3&r2=1.4
http://cvs.eby-sarna.com/PyProtocols/src/protocols/tests/test_dispatch.py.diff?r1=1.3&r2=1.4

To generate a diff of this commit:
cvs rdiff -r1.4 -r1.5 PyProtocols/TODO.txt
cvs rdiff -r1.3 -r1.4 PyProtocols/src/protocols/dispatch.py
cvs rdiff -r1.3 -r1.4 PyProtocols/src/protocols/tests/test_dispatch.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list