mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-06 11:57:17 +00:00
Document the fact that data classes use __slots__.
This commit is contained in:
parent
89a418a388
commit
2fd63fc3dd
@ -440,6 +440,15 @@ Some classes are just there to be data containers, this lists them.
|
|||||||
:ref:`discord-api-events`.
|
: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
|
Object
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user