Skip to content

Commit cf810ca

Browse files
authored
Merge branch 'master' into fix-help-duplicate-cmds
Signed-off-by: Paillat <[email protected]>
2 parents 14ddc85 + 52ee8fb commit cf810ca

File tree

8 files changed

+16
-10
lines changed

8 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ These changes are available on the `master` branch, but have not yet been releas
6262
([#2624](https://github.com/Pycord-Development/pycord/pull/2624))
6363
- Fixed `AttributeError` when accessing `Member.guild_permissions` for user installed
6464
apps. ([#2650](https://github.com/Pycord-Development/pycord/pull/2650))
65+
- Fixed type annotations of cached properties.
66+
([#2635](https://github.com/Pycord-Development/pycord/issues/2635))
6567
- Fixed `BridgeCommand` duplicate in default help command.
6668
([#2656](https://github.com/Pycord-Development/pycord/pull/2656))
6769

discord/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ def _handle_ready(self) -> None:
310310

311311
@property
312312
def latency(self) -> float:
313-
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds.
313+
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds. If no websocket
314+
is present, this returns ``nan``, and if no heartbeat has been received yet, this returns ``float('inf')``.
314315
315316
This could be referred to as the Discord WebSocket protocol latency.
316317
"""

discord/gateway.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,9 @@ async def received_message(self, msg, /):
581581

582582
@property
583583
def latency(self) -> float:
584-
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds."""
584+
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds. If no heartbeat
585+
has been received yet this returns ``float('inf')``.
586+
"""
585587
heartbeat = self._keep_alive
586588
return float("inf") if heartbeat is None else heartbeat.latency
587589

discord/shard.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ async def connect(self) -> None:
294294

295295
@property
296296
def latency(self) -> float:
297-
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds for this shard."""
297+
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds for this shard. If no heartbeat
298+
has been received yet this returns ``float('inf')``.
299+
"""
298300
return self._parent.ws.latency
299301

300302
def is_ws_ratelimited(self) -> bool:

discord/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
Iterator,
5757
Literal,
5858
Mapping,
59-
NewType,
6059
Protocol,
6160
Sequence,
6261
TypeVar,
@@ -151,7 +150,7 @@ def __get__(self, instance, owner):
151150
class _RequestLike(Protocol):
152151
headers: Mapping[str, Any]
153152

154-
cached_property = NewType("cached_property", property)
153+
cached_property = property
155154

156155
P = ParamSpec("P")
157156

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"setuptools>=62.6,<=75.5.0",
3+
"setuptools>=62.6,<=75.6.0",
44
"setuptools-scm>=6.2,<=8.1.0",
55
]
66
build-backend = "setuptools.build_meta"

requirements/dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
-r _.txt
2-
pylint~=3.3.1
3-
pytest~=8.3.3
2+
pylint~=3.3.2
3+
pytest~=8.3.4
44
pytest-asyncio~=0.23.8
55
# pytest-order~=1.0.1
66
mypy~=1.13.0
77
coverage~=7.6
88
pre-commit==4.0.1
99
codespell==2.3.0
10-
bandit==1.7.10
10+
bandit==1.8.0
1111
flake8==7.1.1

requirements/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ sphinxext-opengraph==0.9.1
66
sphinx-copybutton==0.5.2
77
furo==2024.8.6
88
sphinx-autodoc-typehints==2.2.3
9-
sphinx-intl==2.3.0
9+
sphinx-intl==2.3.1
1010
typing_extensions==4.12.2
1111
levenshtein==0.26.1

0 commit comments

Comments
 (0)