From 2fd63fc3ddb685f9a188c2af444458aac07cc998 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 7 Jan 2016 00:13:38 -0500 Subject: [PATCH] Document the fact that data classes use __slots__. --- docs/api.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index 62ea915dc..b022f2989 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 `. + Object ~~~~~~~