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

Refactor handling settings #6

Open
stiffneckjim opened this issue Oct 15, 2024 · 0 comments
Open

Refactor handling settings #6

stiffneckjim opened this issue Oct 15, 2024 · 0 comments

Comments

@stiffneckjim
Copy link
Contributor

From review of #3 by @sfkleach:
The bottom of load_imdb.py has a if name == "main": clause. A really good rule is to never declare any variables in this section. This rule works to prevent awkward clashes and as a rule-of-thumb that it has got too big. The arguments are unpacked from a namespace into the global variable SETTINGS, which is a dict. My suggestion is firstly, how about make SETTINGS a namespace and then do SETTINGS = parser.parse_args()?

And I would be tempted to do away with a global SETTINGS by adding a class LoadIMDB: and stuffing all the methods into it. And then the global SETTINGS becomes an ordinary instance 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

When branches are created from issues, their pull requests are automatically linked.

1 participant