Skip to content

Commit

Permalink
Improve performance of constructing query strings with int values (
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 13, 2024
1 parent 5d6ff6c commit 4782275
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/1259.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved performance of constructing query strings with ``int`` values -- by :user:`bdraco`.
2 changes: 2 additions & 0 deletions yarl/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,8 @@ def _query_var(v: QueryVariable) -> str:
if TYPE_CHECKING:
assert isinstance(v, str)
return v
if cls is int: # Fast path for non-subclassed int
return str(v)
if issubclass(cls, float):
if TYPE_CHECKING:
assert isinstance(v, float)
Expand Down

0 comments on commit 4782275

Please sign in to comment.