E&S CVS Commit: PyProtocols - Added 'when()' methods to generic functions, so that it's easier to add

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


Module Name:	PyProtocols
Committed By:	pje
Date:		Sun Nov  7 06:49:55 UTC 2004

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

Log Message:
Added 'when()' methods to generic functions, so that it's easier to add
cases to generic functions in other modules, e.g.::

    @config.getStreamFactory.when([str,unicode])
    def open_url(source, context):
        # etc.

Also, if you are only using 'SimpleGeneric' functions, you can avoid
loading the parser and predicate modules if you only use 'when()' methods
instead of calling 'dispatch.when()'.


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

To generate a diff of this commit:
cvs rdiff -r1.2 -r1.3 PyProtocols/src/dispatch/functions.py \
    PyProtocols/src/dispatch/interfaces.py
cvs rdiff -r1.12 -r1.13 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