Skip to content

Python style guideliness: function ordering #26

Open
@MVrachev

Description

@MVrachev

There are two ways to order functions:

  1. all local functions from the module you use are above the function you are looking:
def foo():
  ...

def bar():
  ...
  foo()
  ...
  1. all functions from the modules you use are below the function you are looking:
def bar():
  ...
  foo()
  ...

def foo():
  ...

Which of the above two options do you prefer?

Of course, sometimes you will reuse functions all around the file, but the point of this issue
is to define a standard way of function ordering, so when you open a new module you will know where to look
for local functions, you are calling.

PS: I didn't see any opinion on that matter from the Google python style guideliness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions