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

Easier FORMATTER indenting with context manager? #90

Open
davidorme opened this issue Nov 13, 2023 · 1 comment
Open

Easier FORMATTER indenting with context manager? #90

davidorme opened this issue Nov 13, 2023 · 1 comment

Comments

@davidorme
Copy link
Collaborator

We could potentially avoid all the:

FORMATTER.push()
...
FORMATTER.pop()

By defining a context manager:

with FORMATTER.indent_by():
    ...

I think this is clearer, although makes indentation in the code deeper.

@jacobcook1995
Copy link
Collaborator

I think the switch makes sense (provided that it doesn't entail too much work). Just in the sense that a context managers are standard python syntax, whereas I lost a bit of time due to not paying enough attention to the exact placement of FORMATTER.push() and pop() statements

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

2 participants