Make `framework` as class property
# What does this PR do?

Similar to #24299, make this property at class level. (Not the most interesting/useful change though, I agree).

(This approach is a bit hacky but it works. Deprecated in python 3.11.)