Skip to content

Make Environ handle "in" and "get()" like a dict

Some standard Python dict code doesn't work on chutney's Environ class:

is_in_env = 'foo' in self._env
value_or_none = self._env.get('foo')

"in" should return a boolean, and "get()" should return the value (or None).

But instead, when the key is missing, sometimes they throw a KeyError. (It seems to happen in certain contexts, but not others.)

We should work out if Environ is missing some of the required dict implementation functions. Or if there is some issue with Environ's lookup code.

Then we should implement unit tests, to make sure we don't break Environ in future.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information