More Under The Hood

Here's the part of the Pattern class that implements the "&" operator:

class Pattern:
   ...
   def __and__ (self, other): # self & other
      return AndP (self, other)
   ...
New Models for Processing Text and XML with Python Sam Wilmott
Slide 19 of 51         example www.wilmott.ca