diff --git a/poetry.lock b/poetry.lock index 01cb942c..3391a8ac 100644 --- a/poetry.lock +++ b/poetry.lock @@ -851,14 +851,14 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pyright" -version = "1.1.318" +version = "1.1.326" description = "Command line wrapper for pyright" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.318-py3-none-any.whl", hash = "sha256:056c1b2e711c3526e32919de1684ae599d34b7ec27e94398858a43f56ac9ba9b"}, - {file = "pyright-1.1.318.tar.gz", hash = "sha256:69dcf9c32d5be27d531750de627e76a7cadc741d333b547c09044278b508db7b"}, + {file = "pyright-1.1.326-py3-none-any.whl", hash = "sha256:f3c5047465138558d3d106a9464cc097cf2c3611da6edcf5b535cc1fdebd45db"}, + {file = "pyright-1.1.326.tar.gz", hash = "sha256:cecbe026b14034ba0750db605718a8c2605552387c5772dfaf7f3e632cb7212a"}, ] [package.dependencies] @@ -1445,4 +1445,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "0bff26949175c9e1b574115a70e16186a554b03445470c966295a1e05d36ff9a" +content-hash = "0722cd8ed9fc26ddcfc0ce75abbccdac002ca6e25aff76da8f284188a15738c2" diff --git a/pyproject.toml b/pyproject.toml index 5bd78c4b..d3fce957 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ tokenizers = ">= 0.13.0" [tool.poetry.group.dev.dependencies] -pyright = "1.1.318" +pyright = "1.1.326" mypy = "1.4.1" black = "23.3.0" respx = "0.19.2" diff --git a/src/anthropic/_models.py b/src/anthropic/_models.py index 164987a7..296d36c0 100644 --- a/src/anthropic/_models.py +++ b/src/anthropic/_models.py @@ -215,7 +215,7 @@ def validate_type(*, type_: type[_T], value: object) -> _T: if inspect.isclass(type_) and issubclass(type_, pydantic.BaseModel): return cast(_T, parse_obj(type_, value)) - return _validate_non_model_type(type_=type_, value=value) + return cast(_T, _validate_non_model_type(type_=type_, value=value)) # our use of subclasssing here causes weirdness for type checkers,