Skip to content

Commit

Permalink
Use correct union type for provider argument (#1840)
Browse files Browse the repository at this point in the history
fixes #1839
  • Loading branch information
DanielSchaffer authored Apr 4, 2023
1 parent e58414b commit 5d5c10e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions faker/generator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import random as random_module
import re

from typing import TYPE_CHECKING, Any, Callable, Dict, Hashable, List, Optional
from typing import TYPE_CHECKING, Any, Callable, Dict, Hashable, List, Optional, Type, Union

from .typing import SeedType

Expand Down Expand Up @@ -29,7 +29,7 @@ def __init__(self, **config: Dict) -> None:
self.__config = dict(list(self.__config.items()) + list(config.items()))
self.__random = random

def add_provider(self, provider: "BaseProvider") -> None:
def add_provider(self, provider: Union["BaseProvider", Type["BaseProvider"]]) -> None:
if isinstance(provider, type):
provider = provider(self)

Expand Down

0 comments on commit 5d5c10e

Please sign in to comment.