Repository: pydantic/pydantic

Issue:
bug: cannot instantiate PEP 593 type alias
```python
from dataclasses import dataclass
from typing import Annotated
from pydantic import BaseModel

@dataclass
class DataclassModel:
    foo: str = "123"

DataclassAlias = Annotated[DataclassModel, "bar baz"]

DataclassAlias()  # works

class PydanticModel(BaseModel):
    foo: str = "123"

PydanticAlias = Annotated[PydanticModel, "bar baz"]

PydanticAlias()  # error
#   File ".../typing.py", line 680, in __call__
#     result.__orig_class__ = self
#   File "pydantic/main.py", line 347, in pydantic.main.BaseModel.__setattr__
# ValueError: "PydanticModel" object has no field "__orig_class__"
```


Comments:
I just hit something throwing the same error.  Pydantic version 1.8.2 (because 1.9.0 doesn't work for other reasons).
I'm getting a similar error while using generics

```
T = TypeVar('T', bound=BaseModel)

class Paginated(Generic[T], BaseModel):
    total: int
    total_pages: int
    page: int
    per_page: int
    items: List[T]
```

and I'm doing something like this when it throws the error

```
Paginated[PydenticModelSchema](
        total=qs._pagination.total_results,
        total_pages=qs._pagination.num_pages,
        page=qs._pagination.page_number,
        per_page=qs._pagination.page_size,
        items=qs.results,
    )
```

but it works if I remove the generic type and just use `List[Any]`

```
class Paginated(BaseModel):
    total: int
    total_pages: int
    page: int
    per_page: int
    items: List[Any]
```

Is it because of the same bug? I couldn't find anything related to this online
@iodsfx3d you should use `GenericModel` like explained in the doc
```py
from pydantic.generics import GenericModel
...

T = TypeVar('T', bound=BaseModel)

class Paginated(GenericModel, Generic[T]):
    total: T


Paginated[str](total='qwe')
```
@adriangb Yep indeed! `Annotated` seems to add a dunder attribute which can't be set because of our custom `__setattr__`. I'll make a quick fix

Patch:
diff --git a/pydantic/main.py b/pydantic/main.py
--- a/pydantic/main.py
+++ b/pydantic/main.py
@@ -53,6 +53,7 @@
     update_model_forward_refs,
 )
 from .utils import (
+    DUNDER_ATTRIBUTES,
     ROOT_KEY,
     ClassAttribute,
     GetterDict,
@@ -350,7 +351,7 @@ def __init__(__pydantic_self__, **data: Any) -> None:
 
     @no_type_check
     def __setattr__(self, name, value):  # noqa: C901 (ignore complexity)
-        if name in self.__private_attributes__:
+        if name in self.__private_attributes__ or name in DUNDER_ATTRIBUTES:
             return object_setattr(self, name, value)
 
         if self.__config__.extra is not Extra.allow and name not in self.__fields__:
@@ -891,7 +892,9 @@ def __eq__(self, other: Any) -> bool:
 
     def __repr_args__(self) -> 'ReprArgs':
         return [
-            (k, v) for k, v in self.__dict__.items() if k not in self.__fields__ or self.__fields__[k].field_info.repr
+            (k, v)
+            for k, v in self.__dict__.items()
+            if k not in DUNDER_ATTRIBUTES and (k not in self.__fields__ or self.__fields__[k].field_info.repr)
         ]
 
 
diff --git a/pydantic/utils.py b/pydantic/utils.py
--- a/pydantic/utils.py
+++ b/pydantic/utils.py
@@ -76,6 +76,7 @@
     'ROOT_KEY',
     'get_unique_discriminator_alias',
     'get_discriminator_alias_and_values',
+    'DUNDER_ATTRIBUTES',
     'LimitedDict',
 )
 
@@ -680,15 +681,19 @@ def is_valid_field(name: str) -> bool:
     return ROOT_KEY == name
 
 
+DUNDER_ATTRIBUTES = {
+    '__annotations__',
+    '__classcell__',
+    '__doc__',
+    '__module__',
+    '__orig_bases__',
+    '__orig_class__',
+    '__qualname__',
+}
+
+
 def is_valid_private_name(name: str) -> bool:
-    return not is_valid_field(name) and name not in {
-        '__annotations__',
-        '__classcell__',
-        '__doc__',
-        '__module__',
-        '__orig_bases__',
-        '__qualname__',
-    }
+    return not is_valid_field(name) and name not in DUNDER_ATTRIBUTES
 
 
 _EMPTY = object()


Test patch:
diff --git a/tests/test_main.py b/tests/test_main.py
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -19,6 +19,7 @@
 from uuid import UUID, uuid4
 
 import pytest
+from typing_extensions import Annotated
 
 from pydantic import (
     BaseConfig,
@@ -2174,6 +2175,19 @@ class Model(BaseModel):
     }
 
 
+def test_annotated_class():
+    class PydanticModel(BaseModel):
+        foo: str = '123'
+
+    PydanticAlias = Annotated[PydanticModel, 'bar baz']
+
+    pa = PydanticAlias()
+    assert isinstance(pa, PydanticModel)
+    pa.__doc__ = 'qwe'
+    assert repr(pa) == "PydanticModel(foo='123')"
+    assert pa.__doc__ == 'qwe'
+
+
 @pytest.mark.parametrize(
     'ann',
     [Final, Final[int]],