什么是政治公众人物:预计2人在pycharm中的代码中找到1个空行

2024-04-25 12:23:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着重做间隔,但仍然显示错误。你知道吗

  return moves

def available_actions(self):
    """Returns all of the available actions in this room."""
    moves = self.adjacent_moves()
    moves.append(Actions.ViewInventory())

    assert isinstance(moves, object)
    return moves


Tags: oftheinselfactions间隔returndef
1条回答
网友
1楼 · 发布于 2024-04-25 12:23:03

PEP 8 relevant portion

Surround top-level function and class definitions with two blank lines.

Method definitions inside a class are surrounded by a single blank line.

Extra blank lines may be used (sparingly) to separate groups of related functions. Blank lines may be omitted between a bunch of related one-liners (e.g. a set of dummy implementations).

Use blank lines in functions, sparingly, to indicate logical sections.

Python accepts the control-L (i.e. ^L) form feed character as whitespace; Many tools treat these characters as page separators, so you may use them to separate pages of related sections of your file. Note, some editors and web-based code viewers may not recognize control-L as a form feed and will show another glyph in its place.

相关问题 更多 >