June 2019
Beginner to intermediate
770 pages
19h 24m
English
This three-stage process to set the environment variables includes many common sources of parameters and configuration settings. We don't always need environment variables, configuration files, and command-line options; some applications may only need a subset of these techniques.
We often need type conversions that will preserve None values. Keeping the None values will ensure that we can tell when an environment variable was not set. Here's a more sophisticated type conversion that can be called None-aware:
from typing import Optionaldef nint(x: Optional[str]) -> Optional[int]: if x is None: return x return int(x)
We use this when converting environment variable values to integers. If an ...
Read now
Unlock full access