> On Mar 20, 2015, at 1:09 PM, [email protected] wrote: > > Added: steve/trunk/pytest/www/cgi-bin/lib/voter.py > URL: > http://svn.apache.org/viewvc/steve/trunk/pytest/www/cgi-bin/lib/voter.py?rev=1668140&view=auto > > <http://svn.apache.org/viewvc/steve/trunk/pytest/www/cgi-bin/lib/voter.py?rev=1668140&view=auto> > ============================================================================== > --- steve/trunk/pytest/www/cgi-bin/lib/voter.py (added) > +++ steve/trunk/pytest/www/cgi-bin/lib/voter.py Fri Mar 20 20:09:42 2015 > @@ -0,0 +1,40 @@ > +import hashlib, json, random > +from __main__ import homedir
Importing from __main__ is a brittle practice. It’s better to either explicitly pass it to functions or create a class that will hold the context that contains homedir and config. Aesthetically, camel case identifiers should be reserved for class names. Use lower case characters for everything else and separate words with underscores “_”. Finally, never comment out code; that’s what Subversion is for. Just delete it. Mmmmmmm, all this lovely Python code. Can’t wait to ditch the Perl stuff… ;) Regards, Alan
