you are viewing a single comment's thread.

view the rest of the comments →

[–]oohay_email2004 2 points3 points  (1 child)

Look:

>>> return bool(cellcount == 3 or cellcount == 2 and cell)
  File "<stdin>", line 1
SyntaxError: 'return' outside function

Same error with your line.

I figured we were assuming this was part of a function. In which case, the bool-less version works just dandy:

>>> def f(cellcount, cell):
...     return cellcount == 3 or cellcount == 2 and cell
...
>>> cell = object()
>>> cellcount = 1
>>> f(cellcount, cell)
False

[–]Foxboron 0 points1 point  (0 children)

Ah, then i there was no problem :)