alecthomas / voluptuous

CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.
https://pypi.org/project/voluptuous
BSD 3-Clause "New" or "Revised" License
1.81k stars 219 forks source link

Mypy type hint error #491

Closed Kontrolix closed 2 months ago

Kontrolix commented 10 months ago

With the new release 0.14.0, we experienced a lot of mypy errors due to a bad type hint such as:

error: Argument 1 to "Coerce" has incompatible type "Callable[[Any, int, bool], Any]"; expected "type"  [arg-type]
error: Value of type "Schema" is not indexable  [index]
error: Unsupported target for indexed assignment ("Schema")  [index]
error: Returning Any from function declared to return "Schema"  [no-any-return]

I tried to fix the Coerce one here but I am facing some compatibility issues in the CI with python 3.7, 3.8, 3.9.

If we want to support mypy and type hint, do we really want to continue to support these old versions?

antoni-szych-rtbhouse commented 9 months ago

side note:

alecthomas commented 9 months ago

I'm fine with dropping support for EOL Python versions.

spacegaier commented 2 months ago

@Kontrolix With the recent fixes in 0.15.x, are you still facing issues or can this issue be closed?

Kontrolix commented 2 months ago

Sorry, but I'm no longer working for the company where I met those errors. So I can't tell you.

I gess we can close this issue.