0

Are there any brackets, like "[]", "{}", "()", etc., that can be used in my code so that I can fold multiple lines of variables/defining, without affecting my code?

For example:

{
    yes = 1
    no = 0
    maybe = 0.5
}

So that I can fold the text to:

{...}
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Andrew
  • 146
  • 2
  • 11
  • No there isn't - if you need more compact definitions you could use other types (e.g. Dict) – po.pe May 13 '20 at 05:50

1 Answers1

3

A long time ago a plugin existed, allowing using « code regions ». These code regions were determined by the format of the comments.

The editor was then able to collapse the code regions with a single click, but, I think that Python natively does not support this.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
nilleb
  • 967
  • 6
  • 28
  • 2
    But as you can see elsewhere on slack, somebody prefers not to use code level solutions https://stackoverflow.com/a/360634/1328968 because this can reduce the maintainability of the code. – nilleb May 13 '20 at 05:55