Applied Black plus some extra type hints

This commit is contained in:
Simon Willison 2021-08-18 14:55:37 -07:00
commit 282e81362a
2 changed files with 10 additions and 4 deletions

View file

@ -33,7 +33,13 @@ setup(
extras_require={
"test": ["pytest", "black", "hypothesis"],
"docs": ["sphinx_rtd_theme", "sphinx-autobuild", "codespell"],
"mypy": ["mypy", "types-click", "types-tabulate", "types-python-dateutil", "data-science-types"],
"mypy": [
"mypy",
"types-click",
"types-tabulate",
"types-python-dateutil",
"data-science-types",
],
"flake8": ["flake8"],
},
entry_points="""

View file

@ -277,7 +277,7 @@ class Database:
def __init__(
self,
filename_or_conn=None,
filename_or_conn: Union[str, pathlib.Path, sqlite3.Connection] = None,
memory: bool = False,
recreate: bool = False,
recursive_triggers: bool = True,
@ -331,7 +331,7 @@ class Database:
"""
return self.table(table_name)
def __repr__(self):
def __repr__(self) -> str:
return "<Database {}>".format(self.conn)
def register_function(
@ -1069,7 +1069,7 @@ class Table(Queryable):
return next(iter(counts.values()))
return self.count_where()
def exists(self):
def exists(self) -> bool:
return self.name in self.db.table_names()
@property