Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type-casting methods should return the exact type #367

Open
senese opened this issue Nov 13, 2024 · 0 comments
Open

Type-casting methods should return the exact type #367

senese opened this issue Nov 13, 2024 · 0 comments

Comments

@senese
Copy link
Contributor

senese commented Nov 13, 2024

Using environs I noticed that type-casting methods they don't return the type casted, only Unknown,

image

If the intention is to cast the environment variable to the correct type it should let your IDE know that it is indeed that type being returned. Environs should leverage marshmallow to return the exact type that is being casted. Type checkers like mypy would benefit from this behavior as well.

One more thing is that type-casting methods are not exactly methods and are being treated as variables although the syntax used is like calling functions. Maybe this should be reviewed in the next version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant