python development practices?

Neal Norwitz neal at metaslash.com
Wed Oct 31 12:06:58 EST 2001


Peter Wang wrote:
> 
> On Wed, 31 Oct 2001 16:33:08 +1100, "Darren Collins"
> <collinda at nortelnetworks.com> wrote:

> >If people can see that something is supposed to be private, but they
> >absolutely need access to it, then they have just discovered an interface
> >problem. They can either fix the interface or put a quick hack in their code
> >to to work around it by accessing the 'private' member. But they put in the
> >hack knowing that they are breaking the original designer's intentions, so
> >they're on their own. It is nice that you can do this when you really need
> >to, though.
> 
> my question, all along, was not whether python works well when used
> with good development practice.  my question was to discover if there
> were any "safety nets" that other development teams might have erected
> for lapses in process.  if there are none, maybe we can think of some.
> if there are none because none are possible, then that's a different
> issue.
> 
> i've been getting a lot of "there aren't any because you need good
> development practices" answers, which seems equivalent to "this car
> doesn't have airbags because you should wear your seatbelts".  in the
> long term this is good because it forces people to wear seatbelts,
> but it doesn't answer the question about how we save the ones that
> don't.

I wrote PyChecker (http://pychecker.sf.net) to help alleviate 
some of these problems/concerns.  It can check for potential bugs,
as well as, more stylistic issues (too many lines in a function or
return statements).  In the future, I intend to add a check for accessing
an attribute outside an object.  Many checks of this sort can be added.

Unit testing is a must, but pychecker can help in code that doesn't
get exercised in the tests.

Neal



More information about the Python-list mailing list