Closed aThorp96 closed 9 months ago
this is a known issue, and there was some investigation in https://github.com/sloria/environs/issues/120 . ultimately, we didn't arrive on good solution there. still open to ideas if we can preserve both conciseness and type correctness, but it turns out to be less straightforward than you think.
closing this for now; any further discussion should happen on #120
Hello! I'm having an issue using this library with in a project with strict typing using pyright. The issue I'm experiencing is that
_field2method
returns atyping.Callable
, but the args and return of thetyping.Callable
is undefined, leading to Pyright identifying that the return type, and thereforeEnv().list
,Env().bool
, etc, having the type(...) -> Unknown
. I recognize that this isn't an easy problem to solve, but I wanted to flag the error and mention that it may be incorrect to includepy.typed
It's incomplete because it doesn't support imports such as marshmallow, but the issue can be seen on line 367 in the code in the Pyright AST viewer