You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: