diff options
| author | Rapptz <[email protected]> | 2016-01-07 00:13:38 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-01-07 00:13:38 -0500 |
| commit | 2fd63fc3ddb685f9a188c2af444458aac07cc998 (patch) | |
| tree | a29b056431a7b2b23b46a8d38035ce9991ca7c6c /docs/api.rst | |
| parent | Add __slots__ for missing classes that didn't have it. (diff) | |
| download | discord.py-2fd63fc3ddb685f9a188c2af444458aac07cc998.tar.xz discord.py-2fd63fc3ddb685f9a188c2af444458aac07cc998.zip | |
Document the fact that data classes use __slots__.
Diffstat (limited to 'docs/api.rst')
| -rw-r--r-- | docs/api.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/api.rst b/docs/api.rst index 62ea915d..b022f298 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -440,6 +440,15 @@ Some classes are just there to be data containers, this lists them. :ref:`discord-api-events`. +.. warning:: + + Nearly all data classes here have `__slots__` defined which means that it is + impossible to have dynamic attributes to the data classes. The only exception + to this rule is :class:`Object` which was designed with dynamic attributes in + mind. + + More information about `__slots__` can be found `in the official python documentation <https://docs.python.org/3/reference/datamodel.html#slots>`. + Object ~~~~~~~ |