diff --git a/docs/environ.rst b/docs/environ.rst new file mode 100644 index 0000000..1ee81ee --- /dev/null +++ b/docs/environ.rst @@ -0,0 +1,17 @@ +Environ +------- + + +.. py:function:: pydu.environ.environ(**kwargs) + + Context manager for updating one or more environment variables. + + Preserves the previous environment variable (if available) and + recovers when exiting the context manager. + + >>> from pydu.environ import environ + >>> with environ(a='a'): + ... print(os.environ['a']) + ... + a + diff --git a/docs/index.rst b/docs/index.rst index f688953..2dbf823 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,6 +26,7 @@ Content console convert dict + environ exception inspect list