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

Maybe make params a class #638

Open
nworden opened this issue Apr 11, 2019 · 0 comments
Open

Maybe make params a class #638

nworden opened this issue Apr 11, 2019 · 0 comments

Comments

@nworden
Copy link
Contributor

nworden commented Apr 11, 2019

Hiroshi brought up that it'd be good to make env a class, and that was done in PR #629. Maybe it'd be a good idea to do something similar with params. It'd probably be simpler with params since they're "dumb" -- there's not any real handler logic involved in setting the params, so the class' constructor could just be passed the request object and set itself up.

As with env, if we made params a class we could reduce the risk of typos, because each parameter name could be defined as a property on the class. (TBH, what made me think of this was pylint complaining that Structs don't have members for various parameters we access as fields of the params variable.)

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

No branches or pull requests

1 participant