Skip to content

Commit 01b308e

Browse files
committed
Added minor improvements
1 parent eee97f1 commit 01b308e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

debug_toolbar/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ def get_name_from_obj(obj: t.Any) -> str:
3434
name = obj.__class__.__name__
3535

3636
if hasattr(obj, "__module__"):
37-
module = obj.__module__
38-
name = f"{module}.{name}"
37+
name = f"{obj.__module__}.{name}"
3938
return name
4039

4140

@@ -60,7 +59,7 @@ def is_coroutine(endpoint: t.Callable) -> bool:
6059
return asyncio.iscoroutinefunction(handler)
6160

6261

63-
def pluralize(value: float, arg: str = "s") -> str:
62+
def pluralize(value: int, arg: str = "s") -> str:
6463
if "," not in arg:
6564
arg = f",{arg}"
6665

@@ -71,7 +70,7 @@ def pluralize(value: float, arg: str = "s") -> str:
7170

7271
singular_suffix, plural_suffix = bits[:2]
7372

74-
if float(value) == 1:
73+
if value == 1:
7574
return singular_suffix
7675
return plural_suffix
7776

0 commit comments

Comments
 (0)