Skip to content

Commit

Permalink
repr improvements, refs #503
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Oct 25, 2022
1 parent 079bf1f commit 7ca497a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sqlite_utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ def __init__(
assert (filename_or_conn is not None and (not memory and not memory_name)) or (
filename_or_conn is None and (memory or memory_name)
), "Either specify a filename_or_conn or pass memory=True"
self.conn = None
if memory_name:
uri = "file:{}?mode=memory&cache=shared".format(memory_name)
self.conn = sqlite3.connect(
Expand Down Expand Up @@ -3534,7 +3535,7 @@ class View(Queryable):
def exists(self):
return True

def __repr__(self):
def __repr__(self) -> str:
return "<View {} ({})>".format(
self.name, ", ".join(c.name for c in self.columns)
)
Expand Down
2 changes: 1 addition & 1 deletion sqlite_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def test_float(self, value):
except (ValueError, TypeError):
return False

def __repr__(self):
def __repr__(self) -> str:
return self.guessed_type + ": possibilities = " + repr(self.couldbe)

@property
Expand Down

0 comments on commit 7ca497a

Please sign in to comment.