python-dotenv icon indicating copy to clipboard operation
python-dotenv copied to clipboard

Fix wrong type annotations

Open oliversen opened this issue 1 year ago • 3 comments

oliversen avatar May 09 '24 16:05 oliversen

They are correct you can use dotenv_path or stream to create a dotenv (which make both optionals). Encoding is also optional for tempfile https://docs.python.org/3/library/tempfile.html.

Matoran avatar May 13 '24 12:05 Matoran

If the Optional type is specified, then we must set the default value for the parameter. In this case, it is necessary to rewrite further code. Correctly dotenv_path: StrPath or dotenv_path: Optional[StrPath] = None

oliversen avatar May 14 '24 18:05 oliversen

I agree with dotenv_path: Optional[StrPath] = None, the DotEnv object is build on load_dotenv which first arg is dotenv_path: Optional[StrPath] = None.

Matoran avatar May 16 '24 10:05 Matoran