Repository: pydantic/pydantic

Issue:
mypy complains about pre=True root validators
# Bug

Please complete:
* OS: **Ubuntu 19.04**
* Python version `import sys; print(sys.version)`: **3.7.3**
* Pydantic version `import pydantic; print(pydantic.VERSION)`: **1.0**

With the code found in the [root validators](https://pydantic-docs.helpmanual.io/usage/validators/#root-validators) documentation:

```py
from pydantic import BaseModel, root_validator


class UserModel(BaseModel):
    username: str
    password1: str
    password2: str

    @root_validator(pre=True)
    def check_card_number_omitted(cls, values):  # type: ignore
        assert 'card_number' not in values, 'card_number should not be included'
        return values
```

Mypy has the following to say:

```
9: error: "classmethod" not callable
```

The following change pleases mypy, but of course that changes the semantics:

```diff
-    @root_validator(pre=True)
+    @root_validator
```


Discussion:

Resolving patch:
diff --git a/pydantic/class_validators.py b/pydantic/class_validators.py
--- a/pydantic/class_validators.py
+++ b/pydantic/class_validators.py
@@ -4,7 +4,7 @@
 from inspect import Signature, signature
 from itertools import chain
 from types import FunctionType
-from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
+from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union, overload
 
 from .errors import ConfigError
 from .typing import AnyCallable
@@ -90,9 +90,23 @@ def dec(f: AnyCallable) -> classmethod:
     return dec
 
 
+@overload
+def root_validator(_func: AnyCallable) -> classmethod:
+    ...
+
+
+@overload
+def root_validator(*, pre: bool = False) -> Callable[[AnyCallable], classmethod]:
+    ...
+
+
 def root_validator(
     _func: Optional[AnyCallable] = None, *, pre: bool = False
 ) -> Union[classmethod, Callable[[AnyCallable], classmethod]]:
+    """
+    Decorate methods on a model indicating that they should be used to validate (and perhaps modify) data either
+    before or after standard model parsing/validation is performed.
+    """
     if _func:
         _check_validator_name(_func)
         f_cls = classmethod(_func)


Test patch:
diff --git a/tests/mypy/modules/success.py b/tests/mypy/modules/success.py
--- a/tests/mypy/modules/success.py
+++ b/tests/mypy/modules/success.py
@@ -6,9 +6,9 @@
 import json
 import sys
 from datetime import datetime
-from typing import Generic, List, Optional, TypeVar
+from typing import Any, Dict, Generic, List, Optional, TypeVar
 
-from pydantic import BaseModel, NoneStr, StrictBool
+from pydantic import BaseModel, NoneStr, StrictBool, root_validator, validator
 from pydantic.dataclasses import dataclass
 from pydantic.fields import Field
 from pydantic.generics import GenericModel
@@ -25,6 +25,19 @@ class Model(BaseModel):
     signup_ts: Optional[datetime] = None
     list_of_ints: List[int]
 
+    @validator('age')
+    def check_age(cls, value: int) -> int:
+        assert value < 100, 'too old'
+        return value
+
+    @root_validator
+    def root_check(cls, values: Dict[str, Any]) -> Dict[str, Any]:
+        return values
+
+    @root_validator(pre=True)
+    def pre_root_check(cls, values: Dict[str, Any]) -> Dict[str, Any]:
+        return values
+
 
 def dog_years(age: int) -> int:
     return age * 7