Repository: wickman/pystachio

Issue:
Choice with container equality
To reproduce:
```
c = C([1, 2, 3])
assert c == C([1, 2, 3])
```
Expected: Should be true
Result: Raises an exception

Discussion:
wickman: LGTM.

Patch:
diff --git a/.travis.yml b/.travis.yml
index 9b8257b..f125de6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,7 @@
 sudo: false
 
 language: python
+dist: trusty
 
 python:
   - "2.6"
diff --git a/pystachio/__init__.py b/pystachio/__init__.py
index 83a8819..fba836a 100644
--- a/pystachio/__init__.py
+++ b/pystachio/__init__.py
@@ -4,31 +4,15 @@ __license__ = 'MIT'
 
 
 import sys
-if sys.version_info < (2, 6, 5):
-  raise ImportError("pystachio requires Python >= 2.6.5")
-
 
 from .base import Environment
-from .basic import (
-    Boolean,
-    Enum,
-    Float,
-    Integer,
-    String)
-from .choice import (
-   Choice
-)
-from .composite import (
-    Default,
-    Empty,
-    Required,
-    Struct)
-from .container import (
-    List,
-    Map)
+from .basic import Boolean, Enum, Float, Integer, String
+from .choice import Choice
+from .composite import Default, Empty, Required, Struct
+from .container import List, Map
 from .naming import Namable, Ref
 from .parsing import MustacheParser
-from .typing import (
-    Type,
-    TypeCheck,
-    TypeFactory)
+from .typing import Type, TypeCheck, TypeFactory
+
+if sys.version_info < (2, 6, 5):
+  raise ImportError("pystachio requires Python >= 2.6.5")
diff --git a/pystachio/choice.py b/pystachio/choice.py
index df226bf..7aa4347 100644
--- a/pystachio/choice.py
+++ b/pystachio/choice.py
@@ -79,7 +79,7 @@ class ChoiceContainer(Object, Type):
         return False
     si, _ = self.interpolate()
     oi, _ = other.interpolate()
-    return si._value == oi._value
+    return si == oi
 
   def _unwrap(self, ret_fun, err_fun):
     """Iterate over the options in the choice type, and try to perform some
diff --git a/tox.ini b/tox.ini
index f2723cf..d176c79 100644
--- a/tox.ini
+++ b/tox.ini
@@ -40,7 +40,7 @@ deps = isort
 commands = isort -ns __init__.py -rc {toxinidir}/setup.py {toxinidir}/pystachio {toxinidir}/tests
 
 [testenv:isort-check]
-basepython = python2.7
+basepython = python3.4
 deps = isort
 commands = isort -ns __init__.py -rc -c {toxinidir}/setup.py {toxinidir}/pystachio {toxinidir}/tests
 


Test patch:
diff --git a/tests/test_choice.py b/tests/test_choice.py
index f7b08b6..0a45030 100644
--- a/tests/test_choice.py
+++ b/tests/test_choice.py
@@ -163,6 +163,7 @@ def test_choice_primlist():
   """Test that choices with a list value work correctly."""
   C = Choice([String, List(Integer)])
   c = C([1, 2, 3])
+  assert c == C([1, 2, 3])
   assert c.check().ok()
   c = C("hello")
   assert c.check().ok()