Skip to content

Regression: add-ons can no longer easily expand BASE_ONLY_SECTIONS Due to frozenset Change #16684

@AAClause

Description

@AAClause

Detailed description of the issue

In #16636 / d7facd1, config.ConfigManager.BASE_ONLY_SECTIONS underwent a mutation from a set to a frozenset.
Sadly, this modification hinders extensions from easily expanding this list.

There are perfectly legit scenarios where an extension’s settings should not be overridden by profiles. Take webAccess, for instance: https://github.com/accessolutions/WebAccessForNVDA/blob/4251aaef8809c658db35536dd7276e20c91121d0/addon/globalPlugins/webAccess/config.py

While we can work around this by doing something like:

config.ConfigManager.BASE_ONLY_SECTIONS = frozenset(config.ConfigManager.BASE_ONLY_SECTIONS | {"myTerrificSection"})

This approach feels inelegant and hacky compared to config.ConfigManager.BASE_ONLY_SECTIONS.add("myTerrificSection")

Is there a specific reason for this change? Is there a better way to achieve the same goal? Yes, I know, BASE_ONLY_SECTIONS is meant to be a constant, and here I am, looking to bend the rules a bit... :)

Thanks!

CC @seanbudd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions