[Python-il] Code Review: Kakurasu Solver
cool-rr at cool-rr.com
Tue Oct 26 00:26:53 IST 2010
On Mon, Oct 25, 2010 at 6:49 PM, Shlomi Fish <shlomif at iglu.org.il> wrote:
> > I have a few general notes:
> > 1. Use new-style classes. (Inherit every class from `object`.)
> What does that give me? Is it compatible with older versions of python?
Here's a piece by Guido:
And a StackOverflow question:
Old-style classes are deprecated and you should never use them.
About compatibility: I think new-style classes go back to Python 2.2.
> > '''The solver instance itself.''' This docstring doesn't help much.
> > I wouldn't use the word instance other, you know that word is used for
> > actual objects.
> > 3.
> > '''A class method that parses the input file and constructs an
> > object.'''. I think this is bad writing style. Much better would be
> > '''Parse the input file and create a Solver.'''
> Fixed, thanks.
> > 'I don't know if you read them, but you should be familiar with PEP 8
> > <http://www.python.org/dev/peps/pep-0008/> and PEP 257
> > <http://www.python.org/dev/peps/pep-0257/>. (I don't follow them
> > completely and you don't have to follow them completely either, but in
> > most things they are good.)
> OK, I'll take a look when I have some spare cycles.
> > I want to note that most of the advice I gave here is about style; I
> > understand if it's not that important to you. I personally care a lot
> > about style, but many Python programmers don't. You can decide
> > yourself which path you want to follow.
> OK, I care about style when it gets in the way of understanding or using
> code. But see:
Thanks for the article.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-il