[Python-checkins] r75051 - in python/branches/py3k: Lib/test/test_range.py Objects/rangeobject.c

R. David Murray rdmurray at bitdance.com
Fri Sep 25 16:57:36 CEST 2009


Just out of curiosity, I did a google code search.  There were over 200
hits for subclasses of int, and while I didn't go through more than the
first few screens, most seemed to be test fixtures, bool subclasses,
or wrappers that added fields so the datatype could be used in a user
interface framework (ie: most did not manipulate __eq__).

This one is somewhat interesting in that it does modify __eq__ in a way
that breaking the invariant would invalidate...but my guess is that it
isn't likely that the data type instances would be tested for membership
in a range:

http://www.google.com/codesearch/p?hl=en&sa=N&cd=14&ct=rc#mFK3cl52xLo/RuleDispatch-0.5a0.dev-r2115/src/dispatch/strategy.py&q=lang:python%20class%5Cs.*%5C((.*,%5Cs)*int(%5Cs*,.*)*%5C)

But this one is much more interesting, and probably right up your alley,
Mark:

http://www.google.com/codesearch/p?hl=en&sa=N&cd=24&ct=rc#2T6lfGELm_A/trunk/Util/llvm/tools/clang/utils/ABITest/Enumeration.py&q=lang:python%20class%5Cs.*%5C((.*,%5Cs)*int(%5Cs*,.*)*%5C)

--David


More information about the Python-checkins mailing list