Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that registry can be used as dictionary #2891

Closed
kapyshin opened this issue Dec 31, 2016 · 3 comments · Fixed by #2893
Closed

Document that registry can be used as dictionary #2891

kapyshin opened this issue Dec 31, 2016 · 3 comments · Fixed by #2893

Comments

@kapyshin
Copy link
Contributor

Currently ability to use Registry as a dict is only implied: for example, it is used in such way in alchemy scaffold to store and retrieve DB session factory. Maybe it is a good idea to explicitly document that Registry is a dict subclass?

@stevepiercy
Copy link
Member

@PavloKapyshin do you mean like this?
http://docs.pylonsproject.org/projects/pyramid/en/latest/api/registry.html

Or something else?

@kapyshin
Copy link
Contributor Author

kapyshin commented Jan 1, 2017

In retrospective, I admit title and text may be a bit misleading :) Basically, I suggest to make __getitem__ and __setitem__ methods (minimal set of methods to avoid relying on implementation details) of Registry part of its documented API.

Why: alchemy scaffolding generates code that relies on config.registry[...]. Generated code is part of an application, so it is nice to have benefits of documented API.

Or maybe I misunderstand something, and that aspect of application registry is documented?

@kapyshin
Copy link
Contributor Author

kapyshin commented Jan 4, 2017

Thank you, @mmerickel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants