Use None as a default arg (#901)

Thanks, @fcatus!

* Use None as a default arg
* Black formatting fix

Co-authored-by: Simon Willison <swillison@gmail.com>
pull/927/head
fcatus 2020-07-31 13:42:38 -05:00 zatwierdzone przez GitHub
rodzic d71b0c0cb9
commit 2d7fa8b905
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -191,7 +191,9 @@ class Filters:
)
_filters_by_key = {f.key: f for f in _filters}
def __init__(self, pairs, units={}, ureg=None):
def __init__(self, pairs, units=None, ureg=None):
if units is None:
units = {}
self.pairs = pairs
self.units = units
self.ureg = ureg

Wyświetl plik

@ -626,7 +626,11 @@ def module_from_path(path, name):
return mod
async def resolve_table_and_format(table_and_format, table_exists, allowed_formats=[]):
async def resolve_table_and_format(
table_and_format, table_exists, allowed_formats=None
):
if allowed_formats is None:
allowed_formats = []
if "." in table_and_format:
# Check if a table exists with this exact name
it_exists = await table_exists(table_and_format)