E&S CVS Commit: PyProtocols - Added indexing for 'is' comparisons, using a new 'Pointer' type that is

pje at eby-sarna.com pje at eby-sarna.com
Sat Feb 5 14:45:00 EST 2005

Module Name:	PyProtocols
Committed By:	pje
Date:		Sat Feb  5 19:44:47 UTC 2005

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

Log Message:
Added indexing for 'is' comparisons, using a new 'Pointer' type that is
hashable regardless of whether its referent is hashable, and compares equal
to the object's id so long as the object remains alive.  (If the object is
not weak-referenceable, the pointer keeps the object alive indefinitely.)
This new facility is a first step towards allowing garbage collection of
rules that reference specific objects, and it also allows fast 'is' tests.

Lots of refactoring was also done.  There's now an 'AbstractCriterion'
base class that makes it easier to create new criteria types, and __slots__
were added to most criteria types to reduce their memory consumption.  The
'NullCriterion' class moved from 'functions' to 'strategy', too.  Last, but
not least, exotic rich comparisons between non-constant expressions are
no longer reversed in a 'not' context.

To view diffs of this commit, you can use the following URL(s):

To generate a diff of this commit:
cvs rdiff -r1.26 -r1.27 PyProtocols/src/dispatch/functions.py
cvs rdiff -r1.13 -r1.14 PyProtocols/src/dispatch/predicates.py
cvs rdiff -r1.20 -r1.21 PyProtocols/src/dispatch/strategy.py
cvs rdiff -r1.33 -r1.34 PyProtocols/src/protocols/tests/test_dispatch.py
cvs rdiff -r1.20 -r1.21 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