Closed orlnub123 closed 3 years ago
It's quite surprising that the default __dir__
implementation in Python 2 lives in dir
instead of in object
. I'll have to rethink this...
This new version should be functionally identical to the previous on Python 3.
I don't think it'd be a good idea to completely change the output of dir
in a patch release so I've made a new 1.1.0
section in the changelog. I can move it to 1.0.4
if you think otherwise.
The custom
__dir__
leaves out some useful attributes. These include values passed toAppConf
, attributes of the holder ifAppConf
is a proxy, theconfigure_*
andconfigure
methods, andconfigured_data
.Here's an example that showcases the above:
Ideally this would print
['DEFAULT_TEST', 'Meta', 'PREFIX_TEST1', 'PREFIX_TEST2', 'PREFIX_TEST3', 'TEST1', 'TEST2', 'TEST3', '_meta', 'configure', 'configure_test1', 'configured_data']
, however it currently only prints['TEST1']
.This PR takes the easy route and uses the default
__dir__
, supplementing it with the holder's__dir__
if the object is a proxy. Unfortunately that means some dunder methods show up. However, that makes it more similar to the__dir__
of Django's settings (and models?).