There are at least three existing ways to already do this.
(foo["bar"]
["baz"]
["eggs"]
["spam"]) = 1
foo["bar"][
"baz"][
"eggs"][
"spam"] = 1
foo["bar"]\
["baz"]\
["eggs"]\
["spam"] = 1
I think the
Op 24/05/2022 om 18:46 schreef Chris Angelico:
(foo["bar"]
["baz"]
["eggs"]
["spam"] = 1)
Not for assignment, unfortunately. And you can't cheat with := either,
since only simple names are permitted.
This would work:
(foo["bar"]
["baz"]
["eggs"]
["spam"])
On Wed, 25 May 2022 at 01:08, Jeremiah Paige wrote:
>
> While that formatting does look nice, this would be a huge change to the
> parser just to allow a new formatting style. Right now lines are only
> logically joined if they appear between a pair of () [] or {}, or if the line
> ends in a
On Tue, 24 May 2022 at 15:42, Jan Costandius wrote:
>
> I think that it would be beneficial for PEP 8 conformance, in the case of
> large nested dicts, if one were able to separate dict indices by a newline.
> What I mean is shown below:
>
> foo["bar"]
> ["baz"]
> ["eggs"]
>
While that formatting does look nice, this would be a huge change to the
parser just to allow a new formatting style. Right now lines are only
logically joined if they appear between a pair of () [] or {}, or if the
line ends in a \. Besides the complication of joining lines under new