aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJames <[email protected]>2021-04-04 23:05:49 +0100
committerGitHub <[email protected]>2021-04-04 18:05:49 -0400
commit34ab772653152d8e448f21cc4ccb9990edafae73 (patch)
treebb46bf3f14be9a672cd37358ad0d6948c6f49cfd /docs
parentFlatten AsyncIterator.flatten (diff)
downloaddiscord.py-34ab772653152d8e448f21cc4ccb9990edafae73.tar.xz
discord.py-34ab772653152d8e448f21cc4ccb9990edafae73.zip
Use typing.Protocol instead of abc.ABCMeta
Diffstat (limited to 'docs')
-rw-r--r--docs/api.rst23
1 files changed, 11 insertions, 12 deletions
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 <py:library/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 <py:library/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: