E&S CVS Commit: PyProtocols - Added generic function to convert arbitrary expressions to indexable tests.

pje at eby-sarna.com pje at eby-sarna.com
Tue Dec 7 13:05:01 EST 2004


Module Name:	PyProtocols
Committed By:	pje
Date:		Tue Dec  7 18:04:18 UTC 2004

Modified Files:
	PyProtocols/src/dispatch: predicates.py strategy.py
	PyProtocols/src/protocols/tests: test_parsing.py

Log Message:
Added generic function to convert arbitrary expressions to indexable tests.
By adding cases to 'predicates.expressionSignature()', you can match a
parsed expression that would ordinarily be converted to a true-false test,
and convert it into an indexed test.  Currently, the generic function only
recognizes 'isinstance()' expressions, but you can extend it to do more
complex matches, and later I plan to add support for 'issubclass' as well.

Also, added 'strategy.default' for easy default methods.


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PyProtocols/src/dispatch/predicates.py.diff?r1=1.6&r2=1.7
http://cvs.eby-sarna.com/PyProtocols/src/dispatch/strategy.py.diff?r1=1.7&r2=1.8
http://cvs.eby-sarna.com/PyProtocols/src/protocols/tests/test_parsing.py.diff?r1=1.14&r2=1.15

To generate a diff of this commit:
cvs rdiff -r1.6 -r1.7 PyProtocols/src/dispatch/predicates.py
cvs rdiff -r1.7 -r1.8 PyProtocols/src/dispatch/strategy.py
cvs rdiff -r1.14 -r1.15 PyProtocols/src/protocols/tests/test_parsing.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