nerdvegas/rez — pull request #117 by fabiencastan (2014-10-27 13:33:06+00:00)
Title: Let user test if an env variable is in environment or not

Hi,

Currently it is not possible to test if a variable is in the environment or not, because the getter creates it automatically.
The goal of this PR is to keep the dictionnary as a standard dictionnary and to keep the magic of empty EnvironmentVariable creation in the AttrDictWrapper.
So it becomes possible to do:
```
if "FOO" in env:
print("Foo is %s" % env.FOO)
```
And:
```
print("Foo is %s" % env.get("FOO", "default value"))
```

```env.BAR = "value"``` and ```env["BAR"] = "value"``` will continue to work as before (because here the variable is created in the setter).

Now, env is a standard dict, so: ```env["BAR_PATH"].append("value")``` will raise.
But ```env.BAR_PATH.append("value")``` will continue to work as before.

Regards,
Fabien