Skip to content

Commit

Permalink
Small Pythonic code changes for datastructures.py file (#1167)
Browse files Browse the repository at this point in the history
* Small Pythonic code changes for datastructures.py file

* Reverting back .gitignore changes

* reverting back newline in .gitignore

* Reverting back the changes as requested during merge review

Co-authored-by: Marcelo Trylesinski <[email protected]>
  • Loading branch information
ShahriyarR and Kludex authored Jun 11, 2021
1 parent 214d1f1 commit f7aa776
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions starlette/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,7 @@ def make_absolute_url(self, base_url: typing.Union[str, URL]) -> str:
else:
scheme = base_url.scheme

if self.host:
netloc = self.host
else:
netloc = base_url.netloc

netloc = self.host or base_url.netloc
path = base_url.path.rstrip("/") + str(self)
return str(URL(scheme=scheme, netloc=netloc, path=path))

Expand Down Expand Up @@ -246,11 +242,7 @@ def __init__(
) -> None:
assert len(args) < 2, "Too many arguments."

if args:
value = args[0]
else:
value = []

value = args[0] if args else []
if kwargs:
value = (
ImmutableMultiDict(value).multi_items()
Expand Down

0 comments on commit f7aa776

Please sign in to comment.