Use Protocol from typing if available (#402)

Some of the 'experimental' definitions in typing_extensions are added to the typing module in time.

This PR prefers the stdlib imports when available, falling back to typing_extensions as necessary
This commit is contained in:
roywes
2020-11-30 12:09:35 +00:00
committed by GitHub
parent 253e7e0e80
commit 8e82b1e172

View File

@ -1,6 +1,9 @@
from typing import Awaitable, Type
from typing_extensions import Protocol
try:
from typing import Protocol
except:
from typing_extensions import Protocol
from fastapi_users import models
from fastapi_users.db import BaseUserDatabase