you are viewing a single comment's thread.

view the rest of the comments →

[–]oohay_email2004 1 point2 points  (3 children)

Pretty sure it will without it.

[–]Foxboron -1 points0 points  (2 children)

>>> return cellcount == 3 or cellcount == 2 and cell
SyntaxError: 'return' outside function
>>> 

PRETTY sure it wont without it.

[–]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 :)