style: using isinstance function as the main way for type checking
This commit is contained in:
@@ -310,7 +310,7 @@ class AttributesHandler(Mapping[str, _TextHandlerType]):
|
||||
def __init__(self, mapping=None, **kwargs):
|
||||
mapping = (
|
||||
{
|
||||
key: TextHandler(value) if type(value) is str else value
|
||||
key: TextHandler(value) if isinstance(value, str) else value
|
||||
for key, value in mapping.items()
|
||||
}
|
||||
if mapping is not None
|
||||
@@ -320,7 +320,7 @@ class AttributesHandler(Mapping[str, _TextHandlerType]):
|
||||
if kwargs:
|
||||
mapping.update(
|
||||
{
|
||||
key: TextHandler(value) if type(value) is str else value
|
||||
key: TextHandler(value) if isinstance(value, str) else value
|
||||
for key, value in kwargs.items()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ class StorageSystemMixin(ABC):
|
||||
|
||||
@lru_cache(64, typed=True)
|
||||
def _get_base_url(self, default_value: str = "default") -> str:
|
||||
if not self.url or type(self.url) is not str:
|
||||
if not self.url or not isinstance(self.url, str):
|
||||
return default_value
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user