From 34ab772653152d8e448f21cc4ccb9990edafae73 Mon Sep 17 00:00:00 2001 From: James <50501825+Gobot1234@users.noreply.github.com> Date: Sun, 4 Apr 2021 23:05:49 +0100 Subject: Use typing.Protocol instead of abc.ABCMeta --- docs/api.rst | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/api.rst b/docs/api.rst index 4a19c2c7..5ef63f58 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2499,20 +2499,19 @@ interface, :meth:`WebhookAdapter.request`. Abstract Base Classes ----------------------- -An :term:`py:abstract base class` (also known as an ``abc``) is a class that models can inherit -to get their behaviour. The Python implementation of an :doc:`abc ` is -slightly different in that you can register them at run-time. **Abstract base classes cannot be instantiated**. -They are mainly there for usage with :func:`py:isinstance` and :func:`py:issubclass`\. +An :term:`abstract base class` (also known as an ``abc``) is a class that models can inherit +to get their behaviour. **Abstract base classes should not be instantiated**. +They are mainly there for usage with :func:`isinstance` and :func:`issubclass`\. -This library has a module related to abstract base classes, some of which are actually from the :doc:`abc ` standard -module, others which are not. +This library has a module related to abstract base classes, in which all the ABCs are subclasses of +:class:`typing.Protocol`. Snowflake ~~~~~~~~~~ .. attributetable:: discord.abc.Snowflake -.. autoclass:: discord.abc.Snowflake +.. autoclass:: discord.abc.Snowflake() :members: User @@ -2520,7 +2519,7 @@ User .. attributetable:: discord.abc.User -.. autoclass:: discord.abc.User +.. autoclass:: discord.abc.User() :members: PrivateChannel @@ -2528,7 +2527,7 @@ PrivateChannel .. attributetable:: discord.abc.PrivateChannel -.. autoclass:: discord.abc.PrivateChannel +.. autoclass:: discord.abc.PrivateChannel() :members: GuildChannel @@ -2536,7 +2535,7 @@ GuildChannel .. attributetable:: discord.abc.GuildChannel -.. autoclass:: discord.abc.GuildChannel +.. autoclass:: discord.abc.GuildChannel() :members: Messageable @@ -2544,7 +2543,7 @@ Messageable .. attributetable:: discord.abc.Messageable -.. autoclass:: discord.abc.Messageable +.. autoclass:: discord.abc.Messageable() :members: :exclude-members: history, typing @@ -2559,7 +2558,7 @@ Connectable .. attributetable:: discord.abc.Connectable -.. autoclass:: discord.abc.Connectable +.. autoclass:: discord.abc.Connectable() .. _discord_api_models: -- cgit v1.2.3