3 ms·
Use a decorator to expose functions explicitly, otherwise sounds like security issue waiting to happen. All your decorator needs to do is add the function to an
by jitl 2y ago
Use a decorator to expose functions explicitly, otherwise sounds like security issue waiting to happen. All your decorator needs to do is add the function to an __exposed__ set, then when you’re looping over the dict, only expose keys who’s values are in the __exposed__ set
- porridgeraisin 2y agoGood idea Although I suppose using an approach like mine precludes any notion of a serious application.