Repository: chimpler/pyhocon

Issue:
get_list() returns NoneValue's, not None's
Given the following pyhocon file:
```
single_value = null
list_value = [null]
```

And the following code:
```python
from pyhocon import ConfigFactory
config = ConfigFactory.parse_file("test.conf")

single_value = config.get("single_value")
print single_value, single_value is None

list_value = config.get_list("list_value")[0]
print list_value, list_value is None

print single_value == list_value
``` 

You get as output:
```
None True
<pyhocon.config_tree.NoneValue object at 0xe20ad0> False
False
```

I expected both values to be Python's `None`.

Discussion:

Patch:
diff --git a/pyhocon/config_tree.py b/pyhocon/config_tree.py
index 075bae1..354bfb6 100644
--- a/pyhocon/config_tree.py
+++ b/pyhocon/config_tree.py
@@ -93,7 +93,7 @@ class ConfigTree(OrderedDict):
                     self._push_history(key_elt, value)
                     self[key_elt] = value
                 elif isinstance(l, list):
-                    l += value
+                    self[key_elt] = l + value
                     self._push_history(key_elt, l)
                 elif l is None:
                     self._push_history(key_elt, value)
@@ -144,6 +144,8 @@ class ConfigTree(OrderedDict):
         if key_index == len(key_path) - 1:
             if isinstance(elt, NoneValue):
                 return None
+            elif isinstance(elt, list):
+                return [None if isinstance(x, NoneValue) else x for x in elt]
             else:
                 return elt
         elif isinstance(elt, ConfigTree):


Test patch:
diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py
index ca08db6..8d9dffd 100644
--- a/tests/test_config_parser.py
+++ b/tests/test_config_parser.py
@@ -212,9 +212,11 @@ class TestConfigParser(object):
         config = ConfigFactory.parse_string(
             """
             a = null
+            b = [null]
             """
         )
         assert config.get('a') is None
+        assert config.get('b')[0] is None
 
     def test_parse_override(self):
         config = ConfigFactory.parse_string(
diff --git a/tests/test_config_tree.py b/tests/test_config_tree.py
index 97a8e17..3d194de 100644
--- a/tests/test_config_tree.py
+++ b/tests/test_config_tree.py
@@ -9,7 +9,7 @@ except ImportError:  # pragma: no cover
     from ordereddict import OrderedDict
 
 
-class TestConfigParser(object):
+class TestConfigTree(object):
 
     def test_config_tree_quoted_string(self):
         config_tree = ConfigTree()