[omaha] Group Project - status
Jeff Hinrichs - DM&T
jeffh at dundeemt.com
Fri Aug 17 05:58:05 CEST 2007
I've been cleaning up the code some what. Applying some PEP8 style
and writing/stubbing in docstrings. A synopsis is below...
svn log pyorhythms.py
------------------------------------------------------------------------
r8 | dundeemt | 2007-08-16 22:06:57 -0500 (Thu, 16 Aug 2007) | 4 lines
refactored code to correct case|Case|CASE of variables per pylint (pep8)
refactored init method of Person to only expect those args that are
pertinent to object instantiation, moved the others
to simple public variables.
------------------------------------------------------------------------
r7 | dundeemt | 2007-08-16 21:25:58 -0500 (Thu, 16 Aug 2007) | 2 lines
refactored __revision__ string to return a number only
------------------------------------------------------------------------
r6 | dundeemt | 2007-08-16 08:47:51 -0500 (Thu, 16 Aug 2007) | 4 lines
added some doc strings, cleaned up some spacing issues,
added the shell of the usage() function
now pylints out to 6.10
------------------------------------------------------------------------
r5 | dundeemt | 2007-08-14 22:49:21 -0500 (Tue, 14 Aug 2007) | 3 lines
refactored to add cmd line options to specify the title and multiple
people and their
birthdates.
------------------------------------------------------------------------
r4 | dundeemt | 2007-08-13 08:21:00 -0500 (Mon, 13 Aug 2007) | 2 lines
reformatting of source, some additional pylab specific comments
------------------------------------------------------------------------
r3 | dundeemt | 2007-08-12 23:06:14 -0500 (Sun, 12 Aug 2007) | 2 lines
some minor fixups
------------------------------------------------------------------------
r2 | dundeemt | 2007-08-12 22:46:48 -0500 (Sun, 12 Aug 2007) | 2 lines
initial check in of source code
------------------------------------------------------------------------
jlh at dmt600u:~/Projects/omapy/pyorhythms$
Pylint is also complaining about the use of map() -- I can find
Python3k discussions about wanting to remove filter,apply,reduce,map
and lambda -- However I can't find anything specifically saying that
map is out for sure. The only one that seems to be on weak ground is
filter. lambda is not easily replaceable so Guido has given up on
trying to toss it out.
Here is a list of the relevant PEPs:
http://python.org/dev/peps/pep-3000/
http://www.python.org/dev/peps/pep-3100/
http://python.org/dev/peps/pep-3099
Pylint is throwing a W1041
pylint --help-msg W0141
:W0141: *Used builtin function %r*
Used when a black listed builtin function is used (see the bad-function
option). Usual black listed functions are the ones like map, or filter , where
Python offers now some cleaner alternative like list comprehension.
This message belongs to the basic checker.
map in it's simplest form, takes two arguments a function and a list,
then it applies then it returns a list of function results using the
elements from the list as input.
i.e.
def foo(x):
return x*x
lst = [1,2,3]
map(foo, lst) would return [1,4,9]
map(foo, lst) can be replaced with [foo(x) for x in lst]
Maybe I have a deeper affection for list than I realize, but map(foo,
lst) fits in my mind with less thought than [foo(x) for x in lst]
although the latter is more pythonic because it is more explicit.
Comments?
-jeff
More information about the Omaha
mailing list