def merge(self, other):
for key, value in other.items():<EOL><INDENT>if not key in self:<EOL><INDENT>self[key] = value<EOL><DEDENT>elif isinstance(value, (list, tuple)):<EOL><INDENT>self[key] += value<EOL><DEDENT>elif isinstance(value, OrderedSet):<EOL><INDENT>if isinstance(self[key], str):<EOL><INDENT>self[key] = OrderedSet([self[key]])<EOL><DEDENT>elif not isinstance(self[key], OrderedSet):<EOL><INDENT>self[key] = OrderedSet(self[key])<EOL><DEDENT>self[key] |= value<EOL><DEDENT>else:<EOL><INDENT>self[key] = value<EOL><DEDENT><DEDENT>return self<EOL>
Merge other (dict or OrderedSet) into this environment.

        Only works for basic types: str, list, tuple, dict and OrderedSet.