E&S CVS Commit: PyProtocols - Added 'dispatch.SimpleGeneric' for single-dispatch generic functions. You

pje at eby-sarna.com pje at eby-sarna.com
Sun Nov 7 01:25:00 EST 2004


Module Name:	PyProtocols
Committed By:	pje
Date:		Sun Nov  7 06:24:10 UTC 2004

Modified Files:
	PyProtocols/src/dispatch: __init__.py functions.py interfaces.py
	PyProtocols/src/protocols: advice.py
	PyProtocols/src/protocols/tests: test_advice.py test_dispatch.py

Log Message:
Added 'dispatch.SimpleGeneric' for single-dispatch generic functions.  You
can use 'dispatch.when()' and 'defmethod()' to set it up, just as described
in:

    http://www.eby-sarna.com/pipermail/peak/2004-November/001903.html

Also, 'protocols.advice.add_assignment_advisor' has been overhauled to
semi-transparently support Python 2.4 '@' decorators, but the callback
interface had to be changed significantly (there's a new required
parameter for callbacks, and callbacks must now return a value instead of
munging the frame locals).


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PyProtocols/src/dispatch/__init__.py.diff?r1=1.2&r2=1.3
http://cvs.eby-sarna.com/PyProtocols/src/dispatch/functions.py.diff?r1=1.1&r2=1.2
http://cvs.eby-sarna.com/PyProtocols/src/dispatch/interfaces.py.diff?r1=1.1&r2=1.2
http://cvs.eby-sarna.com/PyProtocols/src/protocols/advice.py.diff?r1=1.12&r2=1.13
http://cvs.eby-sarna.com/PyProtocols/src/protocols/tests/test_advice.py.diff?r1=1.8&r2=1.9
http://cvs.eby-sarna.com/PyProtocols/src/protocols/tests/test_dispatch.py.diff?r1=1.11&r2=1.12

To generate a diff of this commit:
cvs rdiff -r1.2 -r1.3 PyProtocols/src/dispatch/__init__.py
cvs rdiff -r1.1 -r1.2 PyProtocols/src/dispatch/functions.py \
    PyProtocols/src/dispatch/interfaces.py
cvs rdiff -r1.12 -r1.13 PyProtocols/src/protocols/advice.py
cvs rdiff -r1.8 -r1.9 PyProtocols/src/protocols/tests/test_advice.py
cvs rdiff -r1.11 -r1.12 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