Code Monkey home page Code Monkey logo

Comments (3)

asottile avatar asottile commented on July 17, 2024

This problem is rooted in pycodestyle:

test.py:6:5: E125 continuation line with same indent as next logical line

honestly there's no "nice" formatting of these continued with statements that appeases both tools :/

I don't think there's anything that can be done here from the add-trailing-comma side -- the code probably just needs to have manual human rewriting:

two withs

with b(c):
    with d(e):
        # ...

not-so-great implicit continuation

with b(
    c,
), d(
    e,
):
    # ...
with b(c), d(
    e,
):
    # ...

I really just wish python let you do something like

with (
    b(c),
    d(e),
):

from add-trailing-comma.

asottile avatar asottile commented on July 17, 2024

Since I don't think there's anything actionable here (other than for the human to pick a different syntax approach that isn't ugly) I'm going to close this. It's good documentation for resolving these conflicts manually though so I'm going to keep documenting these and tagging them with [autopep8]

from add-trailing-comma.

jhereth avatar jhereth commented on July 17, 2024

Here another alternative that makes autopep8 and add-trailing-comma happy (if it fits into one line):

def a():
    with b(c), d(e):
        pass

(Comma behind c and/or e optional)

from add-trailing-comma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.