Skip to content

Conversation

@cansarigol
Copy link
Contributor

Related #241

Copy link
Contributor

@lovelydinosaur lovelydinosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, yup!
One minor point for consideration.

httpx/config.py Outdated
}
else:
self.http_versions = {version.upper() for version in http_versions}
raise ValueError(f"Unsupported HTTP version {http_versions!r}.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should probably raise a type error instead. Something like...

TypeError("HTTP version should be a string or list of strings, but got {type(http_versions)}")?

@cansarigol cansarigol force-pushed the version-config-ref branch 2 times, most recently from 37f7915 to 1e5055a Compare August 20, 2019 19:00
httpx/config.py Outdated
@@ -1,5 +1,6 @@
import ssl
import typing
from collections.abc import Iterable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why collections.abc.Iterable instead of typing.Iterable?
https://docs.python.org/3/library/typing.html#typing.Iterable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think to use types like this :) thanks

httpx/config.py Outdated
else:
self.http_versions = {version.upper() for version in http_versions}
raise TypeError(
f"HTTP version should be a string or list of strings, but got {type(http_versions)}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can break this into two strings to appease flake8:

Suggested change
f"HTTP version should be a string or list of strings, but got {type(http_versions)}"
"HTTP version should be a string or list of strings,"
f" but got {type(http_versions)}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I overlooked flake8 error. if flake8 is not successful, nox can be stopped.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @cansarigol!

@sethmlarson sethmlarson merged commit 4ea4af6 into encode:master Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants