Skip to content

Commit

Permalink
Fix #928
Browse files Browse the repository at this point in the history
  • Loading branch information
lk-geimfari committed Aug 28, 2020
1 parent 42444a2 commit a8e412a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mimesis/schema.py
Expand Up @@ -2,7 +2,6 @@

"""Implements classes for generating data by schema."""

from types import LambdaType
from typing import Any, Callable, List, Optional

from mimesis.exceptions import (
Expand All @@ -17,7 +16,7 @@
__all__ = ['Field', 'Schema']


class AbstractField(object):
class AbstractField:
"""
AbstractField is a class for generating data by the name of the method.
Expand Down Expand Up @@ -116,15 +115,15 @@ def __str__(self):
self.__class__.__name__, self.locale)


class Schema(object):
class Schema:
"""Class which return list of filled schemas."""

def __init__(self, schema: LambdaType) -> None:
def __init__(self, schema: Callable) -> None:
"""Initialize schema.
:param schema: A schema.
"""
if isinstance(schema, LambdaType):
if callable(schema):
self.schema = schema
else:
raise UndefinedSchema()
Expand Down

0 comments on commit a8e412a

Please sign in to comment.