<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,20 +1,32 @@
 class Rules(list):
     &quot;&quot;&quot;A list of rules for identifying effective top-level domains.
 
-    &gt;&gt;&gt; tlds = Rules(['com', '*.org'])
-    &gt;&gt;&gt; 'example.com' in tlds
-    False
+    Rules are formatted as described by the `Public Suffix List`_.
+
+    &gt;&gt;&gt; tlds = Rules()
+
+    Add rules to the list using the ``Rules.load`` method:
+
+    &gt;&gt;&gt; tlds.load(['com', '*.org'])
     &gt;&gt;&gt; 'com' in tlds
     True
+    &gt;&gt;&gt; 'example.com' in tlds
+    False
     &gt;&gt;&gt; 'example.org' in tlds
     True
-    &gt;&gt;&gt; tlds.append('!example.org')
-    &gt;&gt;&gt; 'example.org' in tlds
-    False
 
-    See the `Public Suffix List`__ for more information.
+    ``Rules.load`` will ignore comments and empty rules.  This allows the
+    `Public Suffix List`_ to be loaded unmodified.
 
-    __ http://publicsuffix.org/
+    &gt;&gt;&gt; tlds.load(['// comment', '', '*.net'])
+    &gt;&gt;&gt; '// comment' in tlds
+    False
+    &gt;&gt;&gt; '' in tlds
+    False
+    &gt;&gt;&gt; 'example.net' in tlds
+    True
+
+    .. _`Public Suffix List`: http://publicsuffix.org/
 
     &quot;&quot;&quot;
 
@@ -29,6 +41,17 @@ class Rules(list):
         wildcard = '*.%s' % '.'.join(domain.split('.')[1:])
         return super(Rules, self).__contains__(wildcard)
 
+    def load(self, rules):
+        if isinstance(rules, basestring):
+            rules = [rules]
+        new_rules = []
+        for rule in rules:
+            rule = rule.strip()
+            if not rule or rule.startswith('//'): continue
+            rule = rule.split()[0] # read only to the first white space
+            new_rules.append(rule)
+        self.extend(new_rules)
+
 
 if __name__ == '__main__':
     import doctest</diff>
      <filename>effectivetlds.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>14e0b8bccb6795611fc28a80efd99351cf58108d</id>
    </parent>
  </parents>
  <author>
    <name>Joel Watts</name>
    <email>joel@joelwatts.com</email>
  </author>
  <url>http://github.com/jpwatts/effectivetlds/commit/74aef8f30ba4bf534b15f6f76ca51b1ce33641b0</url>
  <id>74aef8f30ba4bf534b15f6f76ca51b1ce33641b0</id>
  <committed-date>2008-11-19T22:32:43-08:00</committed-date>
  <authored-date>2008-11-19T22:32:43-08:00</authored-date>
  <message>Added ``Rules.load`` method.</message>
  <tree>10b07f9ca136925c139fe88c4c8b4bae4a19a80f</tree>
  <committer>
    <name>Joel Watts</name>
    <email>joel@joelwatts.com</email>
  </committer>
</commit>
