weixin_39759155 2020-11-30 06:51
浏览 0

Use a metaclass for config's singletons

Type

  • [X] Bugfix
  • [ ] Enhancement
  • [ ] New feature

Description of the changes

This is technically a fix. This closes #3136

3136 isn't what we had in mind when handling config as a singleton (and we don't intend for people to think accessing other cog's data should be done without that cog being designed for it), but we should be preventing reinitialization of existing config objects from this.

This also removes the potential for an error to be raised in a safe case of using init_group multiple times in the same config object, allowing multiple cogs to more safely share a config object if related.

It will still error if you try to change the identifier count of a group as this would be unsafe.

该提问来源于开源项目:Cog-Creators/Red-DiscordBot

  • 写回答

5条回答 默认 最新

  • weixin_39759155 2020-11-30 06:51
    关注

    This one shouldn't be merged without signing off on it. It's not a release blocker, and will be moved out of the 3.2 milestone should it not be ready in time.

    评论

报告相同问题?