Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7960)

Issue 235670043: Andrey Drozdowsky - 4

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 11 months ago by tagrimar
Modified:
8 years, 11 months ago
Reviewers:
shad.python
Visibility:
Public.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+457 lines, -0 lines) Patch
M cells.py View 1 chunk +170 lines, -0 lines 0 comments Download
M main.py View 1 chunk +15 lines, -0 lines 0 comments Download
M ocean.py View 1 chunk +69 lines, -0 lines 1 comment Download
M ocean_ut.py View 1 chunk +35 lines, -0 lines 0 comments Download
M parser.py View 1 chunk +100 lines, -0 lines 0 comments Download
M parser_ut.py View 1 chunk +28 lines, -0 lines 0 comments Download
M print_statistic.py View 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 2
tagrimar
8 years, 11 months ago (2015-05-20 14:03:46 UTC) #1
shad.python
8 years, 11 months ago (2015-05-29 18:23:38 UTC) #2
https://codereview.appspot.com/235670043/diff/1/ocean.py
File ocean.py (right):

https://codereview.appspot.com/235670043/diff/1/ocean.py#newcode45
ocean.py:45: for x in range(self.height):
Можно для уменьшения вложенности делать так:

for i, j in itertools.product(range(self.height), range(self.width)):
    ...

Или даже так:

for i, j in itertools.product(*map(range, (self.height, self.width))):
    ...

Еще, так как это часто используется, можно эту конструкцию спрятать в
какую-нибудь функцию.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b