Once you know what you're looking for, intensional sets are *everywhere*.
Python doesn't represent them directly, but regular expressions, many list
comprehensions, and all manner of testing and filtering operations are really
faces of the intensional set concept. Many functions test whether something
Many such tests have a temporal aspect--they determine whether a value is a
-member at the time of the test. In the future, the answer may change, if
-conditions change. Others are invariant over time. ``%%734`` will never be a
+member *right now*. The answer may change in the future, if
+conditions change. Others tests are invariant over time. ``%%734`` will never be a
valid Python identifier, no matter how many times it's tested--unless the rules
-of the overall Python universe change.
+of the overall Python universe change.
Intensional sets are part and parcel of all programming, even if they're not
-called by that name or explictly manifested. ``intensional`` helps Python
-prograims represent intensional sets directly.
+explicitly represented or called by that name.``intensional`` helps Python
+programs represent intensional sets directly. This provides several interesting
+ * A nicer way to use regular expressions
+ * A ``switch`` statement (actually, function) for Python
match = re.search(r'(pattern\w*)', some_string)
You can do an *en passant* test::
+ from intensional import Re
if some_string in Re(r'(pattern\w*)'):
Note this turns the sense of the matching around, asking "is a given string *in*
-this pattern?" The ``Re`` pattern is an intensionally defined set--namely, the
+this pattern?" The ``Re`` pattern is an intensionally defined set--namely, the
set of all strings matching the pattern. This makes excellent sene in cases where
you have a clear intent for the match--for example, determining "is the given string
within the set of *all legitimate commands*?"