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 committed Oct 13, 2024
1 parent 5d6ff6c commit 5e9a2bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yarl/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,8 @@ def _query_var(v: QueryVariable) -> str:
if math.isnan(v):
raise ValueError("float('nan') is not supported")
return str(float(v))
if cls is int:
return str(v)
if cls is not bool and isinstance(cls, SupportsInt):
return str(int(v))
raise TypeError(
Expand Down

0 comments on commit 5e9a2bd

Please sign in to comment.