Skip to content

Commit

Permalink
Change return type hint for create_model (#526)
Browse files Browse the repository at this point in the history
* Change return type hint for create_model, fix #525

* remove unnecessary ignore

* Update HISTORY.rst
  • Loading branch information
dmontagu authored and samuelcolvin committed May 16, 2019
1 parent fe72ba1 commit 9b98d14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -7,6 +7,7 @@ v0.26 (unreleased)
..................
* fix to schema generation for ``IPvAnyAddress``, ``IPvAnyInterface``, ``IPvAnyNetwork`` #498 by @pilosus
* fix variable length tuples support, #495 by @pilosus
* fix return type hint for ``create_model``, #526 by @dmontagu

v0.25 (2019-05-05)
..................
Expand Down
4 changes: 2 additions & 2 deletions pydantic/main.py
Expand Up @@ -526,7 +526,7 @@ def create_model( # noqa: C901 (ignore complexity)
__module__: Optional[str] = None,
__validators__: Dict[str, classmethod] = None,
**field_definitions: Any,
) -> BaseModel:
) -> Type[BaseModel]:
"""
Dynamically create a model.
:param model_name: name of the created model
Expand Down Expand Up @@ -571,7 +571,7 @@ def create_model( # noqa: C901 (ignore complexity)
if __config__:
namespace['Config'] = inherit_config(__config__, BaseConfig)

return type(model_name, (__base__,), namespace) # type: ignore
return type(model_name, (__base__,), namespace)


def validate_model( # noqa: C901 (ignore complexity)
Expand Down

0 comments on commit 9b98d14

Please sign in to comment.