You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python's MRO (Method Resolution Order), a.k.a. the C3 algorithm, should control how an attribute is looked up in a class hierarchy. However, if those classes inherit from configurations.Configuration, the attribute that is found by C3 changes. This appears to be a result of the ConfigurationBase metaclass, which copies attributes from parent classes onto the child class. See the examples below, which differ only by whether BaseConfig inherits from Configuration.
I find it surprising that the value of the DEBUG attribute is not what it should be, as defined by the C3 algorithm. I don't think the ConfigurationBase class should be copying attributes onto child classes. If it didn't, then the C3 algorithm would find the correct value for the DEBUG attribute.
The text was updated successfully, but these errors were encountered:
Python's MRO (Method Resolution Order), a.k.a. the C3 algorithm, should control how an attribute is looked up in a class hierarchy. However, if those classes inherit from
configurations.Configuration
, the attribute that is found by C3 changes. This appears to be a result of theConfigurationBase
metaclass, which copies attributes from parent classes onto the child class. See the examples below, which differ only by whetherBaseConfig
inherits fromConfiguration
.I find it surprising that the value of the
DEBUG
attribute is not what it should be, as defined by the C3 algorithm. I don't think theConfigurationBase
class should be copying attributes onto child classes. If it didn't, then the C3 algorithm would find the correct value for theDEBUG
attribute.The text was updated successfully, but these errors were encountered: