Red-DiscordBot
Red-DiscordBot copied to clipboard
[Config] Prevent registering defaults for inaccessible identifiers
What component of Red (cog, command, API) would you like to see improvements on?
Config
Describe the enhancement you're suggesting.
When registering defaults, we already check that the key is not a Python identifier, however we do not ever check whether the key is an existing attribute of Group or Value that will cause the __getattr__ method to never be called. Examples include:
-
default -
defaults -
identifier_data -
is_value
And more!
A similar check should be added to ensure the key is actually going to be accessible, in order to prevent confusion.
Anything else?
No response
+1 on this, would be an important addition especially with the default identifier as I see that getting used occasionally.