Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python style guideliness: function ordering #26

Open
MVrachev opened this issue Jun 2, 2021 · 0 comments
Open

Python style guideliness: function ordering #26

MVrachev opened this issue Jun 2, 2021 · 0 comments

Comments

@MVrachev
Copy link

MVrachev commented Jun 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant